Re: [PATCH 1/4] sched/fair: Prefer fully-idle SMT cores in asym-capacity idle selection
From: Andrea Righi
Date: Mon Mar 30 2026 - 09:49:19 EST
On Mon, Mar 30, 2026 at 03:22:27PM +0200, Andrea Righi wrote:
> Hi Prateek,
>
> On Mon, Mar 30, 2026 at 03:47:07PM +0530, K Prateek Nayak wrote:
> > Hello Andrea,
> >
> > On 3/27/2026 10:09 PM, Andrea Righi wrote:
> > >> My naive eyes say it should be equivalent of what you have but maybe
> > >> I'm wrong?
> > >
> > > It seems correct to my naive eyes as well. Will test this out to make sure.
> >
> > So I found one small problem with fits > 0 && !preferred_core where even
> > though it is an ideal target, we don't end up preferring it because of
> > the larger "fits" value.
> >
> > Here is an updated diff:
> >
> > (Only build tested)
>
> I'm getting worse performance with this one (but better than mainline).
> I'm trying to understand why.
Nevermind...
>
> BTW, we also need to fix asym_fits_cpu() to do something like this:
>
> return (!sched_smt_active() || is_core_idle(cpu)) &&
> (util_fits_cpu(util, util_min, util_max, cpu) > 0);
>
> ...or we'd return early from select_idle_sibling() with busy SMT cores.
...I was actually missing this piece right here. So, everything looks good
with this extra change applied.
I'll repeat all my tests just in case and will send a new version with your
changes.
Thanks!
-Andrea