diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 035132014817..fa9fff0f9620 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -11121,12 +11121,16 @@ static int should_we_balance(struct lb_env *env) continue; } - /* Are we the first idle CPU? */ + /* + * Are we the first idle core in a non-SMT domain or higher, + * or the first idle CPU in a SMT domain? + */ return cpu == env->dst_cpu; } - if (idle_smt == env->dst_cpu) - return true; + /* Are we the first idle CPU with busy siblings? */ + if (idle_smt != -1) + return idle_smt == env->dst_cpu; /* Are we the first CPU of this group ? */ return group_balance_cpu(sg) == env->dst_cpu;