Re: [PATCH] sched/fair: Force idle aware load balancing
From: Fernand Sieber
Date: Mon Dec 01 2025 - 08:08:54 EST
On Fri, 28 Nov 2025 at 14:58, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> 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.
Thanks. Addressed in rev2, by keeping track of both forceidle_weight and
forceidle_capacity:
https://lore.kernel.org/lkml/20251201124223.247107-1-sieberf@xxxxxxxxxx/
Amazon Development Centre (South Africa) (Proprietary) Limited
29 Gogosoa Street, Observatory, Cape Town, Western Cape, 7925, South Africa
Registration Number: 2004 / 034463 / 07