diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2025-12-03 11:22:53 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-11 15:22:30 +0100 |
| commit | 38d080768c858d482c7465bd0b1a78def5692c36 (patch) | |
| tree | 7b22130377e792a865610d8df1a262814838d929 /kernel | |
| parent | 17d3103325e891e10994e7aa28d12bea04dc2c60 (diff) | |
| download | linux-38d080768c858d482c7465bd0b1a78def5692c36.tar.gz linux-38d080768c858d482c7465bd0b1a78def5692c36.tar.bz2 linux-38d080768c858d482c7465bd0b1a78def5692c36.zip | |
sched/fair: Small cleanup to sched_balance_newidle()
commit e78e70dbf603c1425f15f32b455ca148c932f6c1 upstream.
Pull out the !sd check to simplify code.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Tested-by: Chris Mason <clm@meta.com>
Link: https://patch.msgid.link/20251107161739.525916173@infradead.org
[ Ajay: Modified to apply on v6.6 ]
Signed-off-by: Ajay Kaher <ajay.kaher@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/sched/fair.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 38cc72d203c0..c3bfd02c03b5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -12374,14 +12374,15 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf) rcu_read_lock(); sd = rcu_dereference_check_sched_domain(this_rq->sd); + if (!sd) { + rcu_read_unlock(); + goto out; + } if (!READ_ONCE(this_rq->rd->overload) || - (sd && this_rq->avg_idle < sd->max_newidle_lb_cost)) { - - if (sd) - update_next_balance(sd, &next_balance); + this_rq->avg_idle < sd->max_newidle_lb_cost) { + update_next_balance(sd, &next_balance); rcu_read_unlock(); - goto out; } rcu_read_unlock(); |
