Re: [PATCH] sched/fair: avoid creating misfits during cache-aware balancing
From: Peter Zijlstra
Date: Mon Aug 31 2026 - 05:18:16 EST
On Tue, Aug 25, 2026 at 10:41:12AM -0700, Tim Chen wrote:
> Cache-aware load balancing biases tasks toward their preferred LLC. On
> asymmetric CPU capacity systems (e.g. big.LITTLE) the destination LLC may
> contain CPUs that are too small to run the task. Pulling the task there
> turns it into a misfit, trading a cache-locality gain for a capacity loss
> that's more detrimental to performance.
>
> Guard both cache-aware migration entry points against this:
>
> - can_migrate_llc_task(): forbid the LLC migration when the task fits its
> source CPU but would not fit the destination CPU.
> - alb_break_llc(): veto the active balance under the same condition so the
> runnable task is not pushed onto a CPU that cannot accommodate it.
>
> Both checks are gated with checks for hybrid processors, so symmetric
> systems are unaffected. Tasks that already do not fit their source CPU
> are left to the existing LLC policy, since the move cannot make their
> fitness worse (this also preserves misfit up-migration to bigger CPUs).
>
> Additionally, if there are misfit tasks found in the load balancing
> classification phase, prioritize misfit task migrations
> over LLC load aggregation on asymmetric systems. A better fitting
> CPU will boost performance more than better cache locality.
>
> Reviewed-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
> Tested-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
> Reviewed-by: Chen Yu <yu.c.chen@xxxxxxxxx>
Tim sends patch, Tim adds SoB, yes?
Also, we start $subject with capital after subsystem: part.