Re: [PATCH] sched/fair: Force idle aware load balancing
From: Peter Zijlstra
Date: Fri Nov 28 2025 - 08:58:32 EST
On Fri, Nov 28, 2025 at 02:55:36PM +0100, Vincent Guittot wrote:
> On Thu, 27 Nov 2025 at 21:28, Fernand Sieber <sieberf@xxxxxxxxxx> wrote:
> > @@ -10135,15 +10136,15 @@ static inline int sg_imbalanced(struct sched_group *group)
> > static inline bool
> > group_has_capacity(unsigned int imbalance_pct, struct sg_lb_stats *sgs)
> > {
> > - if (sgs->sum_nr_running < sgs->group_weight)
> > + if (sgs->sum_nr_running < (sgs->group_weight - sgs->forceidle_weight))
> > return true;
> >
> > - if ((sgs->group_capacity * imbalance_pct) <
> > - (sgs->group_runnable * 100))
> > + if ((sgs->group_capacity * imbalance_pct * (sgs->group_weight - sgs->forceidle_weight)) <
> > + (sgs->group_runnable * 100 * sgs->group_weight))
>
> so you apply a ratio on group capacity based on the number of forced
> idle but what if you have heterogeneous systems ?
Ah, good point. I suppose tracking force_idle_capacity in
update_sg_lb_stats() should be possible, and then subtract that from
group_capacity or so.