Re: [PATCH] sched/fair: Force idle aware load balancing
From: Vincent Guittot
Date: Fri Nov 28 2025 - 08:50:23 EST
On Fri, 28 Nov 2025 at 12:14, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Thu, Nov 27, 2025 at 10:27:17PM +0200, Fernand Sieber wrote:
>
> > @@ -11123,7 +11136,8 @@ static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *s
> > return;
> > }
> >
> > - if (busiest->group_type == group_smt_balance) {
> > + if (busiest->group_type == group_smt_balance ||
> > + busiest->forceidle_weight) {
>
> Should we not instead make it so that we select group_smt_balance in
> this case?
Why do we need this test ? We have already removed forced idle cpus
from statistics ?
I suppose Fernand wants to cover cases where there is 1 task per CPUs
so we are balanced but one CPU is forced idle and we want to force
migrating a task to then try to move back another one ? In this case
it should be detected early and become group_imbalanced type
Also what happens if we could migrate more than one task
>
> Anyway, the patch doesn't seem horrible to me. Vincent?
>
> > /* Reduce number of tasks sharing CPU capacity */
> > env->migration_type = migrate_task;
> > env->imbalance = 1;