Re: [REGRESSION] sched/fair: SIS_UTIL limit in select_idle_capacity() leaves busy tasks on little CPUs while big CPUs are idle
From: James Buck
Date: Wed Nov 25 2026 - 17:06:26 EST
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index da0d9e19c457..1c0e2ac7751d 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -12937,8 +12937,9 @@ static void update_idle_cpu_scan(struct lb_env *env,
> y = SCHED_CAPACITY_SCALE - tmp;
>
> /* equation [2] */
> - y *= llc_weight;
> + y *= max(llc_weight, 32);
> do_div(y, SCHED_CAPACITY_SCALE);
> + y = min_t(u64, y, llc_weight);
> if ((int)y != sd_share->nr_idle_scan)
> WRITE_ONCE(sd_share->nr_idle_scan, (int)y);
> }
Thanks, this fixes it on my board also.
Setup as in my report: CIX P1 (8x Cortex-A720 at capacities 1024/984/905/866, 4x Cortex-A520 at 279, one LLC of 12 CPUs), v7.3.5 with this change applied and my local workaround (dropping the SIS_UTIL limit in select_idle_capacity()) removed. llama.cpp on the CPU, Qwen2.5-1.5B Q4_K_M, 8 threads, llama-bench pp512 / tg128 in tok/s:
v6.18 123.5 / 36.5
v7.3.5 109.0 / 29.5
v7.3.5, NO_SIS_UTIL 122.1 / 35.9
v7.3.5 + this patch 122.0 / 35.5
v7.3.5 + this patch, NO_SIS_UTIL 121.2 / 35.8
With the patch, SIS_UTIL on and off are within noise of each other and of v6.18 (about 1%). Sampled thread placement during the run looks the same with SIS_UTIL on and off: the busy threads sit on the A720s, with at most one on an A520 at a time.
Tested-by: James Buck <jbuck2005.linux@xxxxxxxxxxx>
James
________________________________________
From: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
Sent: November 25, 2026 9:27 AM
To: Chen Yu <yu.c.chen@xxxxxxxxx>
Cc: K Prateek Nayak <kprateek.nayak@xxxxxxx>; Andrea Righi <arighi@xxxxxxxxxx>; James Buck <jbuck2005.linux@xxxxxxxxxxx>; Peter Zijlstra <peterz@xxxxxxxxxxxxx>; Ingo Molnar <mingo@xxxxxxxxxx>; Juri Lelli <juri.lelli@xxxxxxxxxx>; Dietmar Eggemann <dietmar.eggemann@xxxxxxx>; Valentin Schneider <vschneid@xxxxxxxxxx>; Usama Arif <usama.arif@xxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>; regressions@xxxxxxxxxxxxxxx <regressions@xxxxxxxxxxxxxxx>
Subject: Re: [REGRESSION] sched/fair: SIS_UTIL limit in select_idle_capacity() leaves busy tasks on little CPUs while big CPUs are idle
On Wed, 25 Nov 2026 at 11:38, Chen Yu <yu.c.chen@xxxxxxxxx> wrote:
>
> On Wed, Nov 25, 2026 at 08:51:39AM +0100, Vincent Guittot wrote:
> > On Wed, 25 Nov 2026 at 03:53, K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
> > >
> > > Hello Andrea,
> > >
> > > On 11/24/2026 6:45 PM, Andrea Righi wrote:
> > > > Hi James,
> > > >
> > > > On Tue, Nov 24, 2026 at 11:56:52AM +0000, James Buck wrote:
> > > >> Hi,
> > > >>
> > > >> Since commit 61ea17a63719 ("sched/fair: Add SIS_UTIL support to select_idle_capacity()"), first in v7.2, CPU-bound multi-threaded work on my big.LITTLE arm64 board runs 12-19% slower than on v7.1 and earlier, because waking threads are placed on idle little CPUs while idle big CPUs are never looked at.
> > > >>
> > > >> Turning SIS_UTIL off at runtime restores the old speed. select_idle_capacity() and update_idle_cpu_scan() are unchanged in v7.4-rc4, so I expect mainline to behave the same.
> > > >
> > > > A related regression from the same commit was reported by Usama here:
> > > > https://lore.kernel.org/r/20261113153157.2495664-1-usama.arif@xxxxxxxxx/
> > > >
> > > > On Grace, a zero SIS_UTIL budget skips the search despite suitable CPUs
> > > > being idle. Your case shows that a nonzero budget can stop the scan
> > > > before reaching an idle big CPU.
> > > >
> > > > We've discussed a minimum scan budget and accounting for idle CPU
> > > > availability, though a small minimum alone may not fix your case.
> > >
> > > This had problems in the past when Chenyu was iterating on SIS_UTIL
> > > where the search opportunity at higher utilization is actually very
> > > low and cutting off search for !idle core was beneficial for SMT
> > > systems.
> > >
> > > Now, for systems without SMT, it has its benefits too but a system
> > > without SMT should be equivalent to a SMT one where test_idle_core()
> > > returns true always if an idle CPU is present.
> > >
> > > So I'm wondering if {set,test}_idle_cores() can be extended !SMT
> > > to act like a gating indicator to say if an idle core exists or
> > > not much like how !get_rd_overloaded(this_rq->rd) serves as a
> > > gate for newidle balance - it can be flipped to true when a CPU
> > > goes idle or if load balancer sees an idle CPU. Thoughts?
> >
> > I tested idle_cores tracking for !SMT and EAS months ago [1]
> > [1] https://lore.kernel.org/all/20251202181242.1536213-6-vincent.guittot@xxxxxxxxxx/
> >
> > >
> > > > Given both reports, reverting the commit seems the safest thing to do
> > > > for now. That would restore the previous asym search behavior and we can
> > > > revisit a better consistent strategy to cover both sym and asym CPU
> > > > selection later.
> > > >
> > > > Prateek, Vincent, what do you think?
> > >
> > > IMO it still makes sense for SMT systems since capacity on systems
> > > with SMT only makes sense if the entire core is idle and then it is
> > > just a best effort thing right?
> > >
> > > set_idle_cores(), would flip the flag as soon as an idle core is
> > > available and after that SIS_UTIL is bypassed. I don't think the
> > > SIS_UTIL cut-off for non-SMT ASYM_CAPACITY systems makes that much
> > > sense given misfit penalty is much higher.
> >
> > In fact that depends on the number of CPUs in your LLC.
> > The current SIS_UTIL is unfair for small system because you skip the
> > loop with "low" utilization:
> > - with 12 cores per LLC, you skip the loop if the avg utilization per
> > cpu is above 839 whereas it also means that you have the compute
> > capacity of more than 2 CPUs that is not used and util_est can worse
> > the situation
> > - but with 64 cores LLC, you still tries 5 CPUs for the same avg
> > utilization per CPU
> > - and with 12864 cores LLC, it's 10 CPUs
> >
> >
>
> As you suggested in [1], maybe we can give a floor value of 3 when has_idle_core
> is true both for SMT and !SMT case(mainly for nr_scan = 0 case). Besides, we can
> scale up the number of CPUs to be scanned by their llc_weight, to fake
> a 32 CPUs LLC for the small LLC system, this should mitigate
> the issue of current report and the issue reported at [1].
This fixes the regression on my radxa O6 by keeping nr_idle_scan full
for llc smaller than 32 CPUs while the avg utilization per CPU is
below ~550
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index da0d9e19c457..1c0e2ac7751d 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -12937,8 +12937,9 @@ static void update_idle_cpu_scan(struct lb_env *env,
> y = SCHED_CAPACITY_SCALE - tmp;
>
> /* equation [2] */
> - y *= llc_weight;
> + y *= max(llc_weight, 32);
> do_div(y, SCHED_CAPACITY_SCALE);
> + y = min_t(u64, y, llc_weight);
> if ((int)y != sd_share->nr_idle_scan)
> WRITE_ONCE(sd_share->nr_idle_scan, (int)y);
> }
> --
> 2.25.1
>
> [1] https://lore.kernel.org/all/CAKfTPtDVqKyQ491MdUr2RbGmJ9ivofiiX7D7Xd-Sh2F0NLFmRw@xxxxxxxxxxxxxx/
> > >
> > > --
> > > Thanks and Regards,
> > > Prateek
> > >