Skip to content

Commit 024c9d2

Browse files
Peter ZijlstraIngo Molnar
authored andcommitted
sched/core: Ensure load_balance() respects the active_mask
While load_balance() masks the source CPUs against active_mask, it had a hole against the destination CPU. Ensure the destination CPU is also part of the 'domain-mask & active-mask' set. Reported-by: Levin, Alexander (Sasha Levin) <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Fixes: 77d1dfd ("sched/topology, cpuset: Avoid spurious/wrong domain rebuilds") Signed-off-by: Ingo Molnar <[email protected]>
1 parent f2cdd9c commit 024c9d2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/sched/fair.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8042,6 +8042,13 @@ static int should_we_balance(struct lb_env *env)
80428042
struct sched_group *sg = env->sd->groups;
80438043
int cpu, balance_cpu = -1;
80448044

8045+
/*
8046+
* Ensure the balancing environment is consistent; can happen
8047+
* when the softirq triggers 'during' hotplug.
8048+
*/
8049+
if (!cpumask_test_cpu(env->dst_cpu, env->cpus))
8050+
return 0;
8051+
80458052
/*
80468053
* In the newly idle case, we will allow all the cpu's
80478054
* to do the newly idle load balance.

0 commit comments

Comments
 (0)