Commit 024c9d2f authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarLevin, Alexander (Sasha Levin) <>
Signed-off-by: default avatarPeter Zijlstra (Intel) <>
Cc: Linus Torvalds <>
Cc: Mike Galbraith <>
Cc: Peter Zijlstra <>
Cc: Thomas Gleixner <>
Fixes: 77d1dfda ("sched/topology, cpuset: Avoid spurious/wrong domain rebuilds")
Signed-off-by: default avatarIngo Molnar <>
parent f2cdd9cc
......@@ -8042,6 +8042,13 @@ static int should_we_balance(struct lb_env *env)
struct sched_group *sg = env->sd->groups;
int cpu, balance_cpu = -1;
* Ensure the balancing environment is consistent; can happen
* when the softirq triggers 'during' hotplug.
if (!cpumask_test_cpu(env->dst_cpu, env->cpus))
return 0;
* In the newly idle case, we will allow all the cpu's
* to do the newly idle load balance.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment