Re: [PATCH 1/2] sched/fair: Prefer fully-idle SMT cores in asym-capacity idle selection

Andrea Righi
2026-04-22T15:29:53Z

On Wed, Apr 22, 2026 at 09:06:40AM +0530, K Prateek Nayak wrote:
> Hello Andrea,
>
> On 4/21/2026 7:08 PM, Andrea Righi wrote:
> >> You can also try "best_fits <= -3" in that last bailout condition and
> >> see if that help.
> >
> > For the bailout condition I don't see much difference using either <= -3 or
> > == -4. In general, I see a small but consistent improvement with the SIS_UTIL
> > logic, especially when the system is close to saturation (as expected).
>
> Thank you for testing! I guess == -4 is safer then.
>
> It is probably best to add an enum of sorts to help distinguish these
> states rather than the magic numbers. Perhaps something like:
>
> enum asym_fits_state {
> /* In descending order of preference */
> ASYM_IDLE_CORE_UCLAMP_MISFIT = -4,
> ASYM_IDLE_CORE_COMPLETE_MISFIT,
> ASYM_IDLE_THREAD_FITS,
> ASYM_IDLE_THREAD_UCLAMP_MISFIT,
> ASYM_IDLE_COMPLETE_MISFIT,
>
> /* asym_fits_cpu() bias for an idle core. */
> ASYM_IDLE_CORE_BIAS = -3,
> };
>
> >
> > So, this looks good to me! Do you want me to include also this one in the new
> > SMT-aware asym cpu capacity patch series (keeping your authorship of course) or
> > do you prefer to route this separately?
>
> I think you can send it as a part of your series for easy review. I'll
> be happy to help reworking those bits based on the comments if folks
> aren't happy with them ;-)

BTW, the SIS_UTIL part also improves performance on Grace (tested also there to
make sure we were not regressing the non-SMT asym-cpu-capacity case).

So, definitely +1 to include this from me. :)

Thanks,
-Andrea