Re: [RFC PATCH v4 07/28] sched: Add helper function to decide whether to allow cache aware scheduling

From: Peter Zijlstra
Date: Wed Oct 01 2025 - 09:18:10 EST


On Sat, Aug 09, 2025 at 01:03:10PM +0800, Chen Yu wrote:
> From: Tim Chen <tim.c.chen@xxxxxxxxxxxxxxx>
>
> Cache-aware scheduling is designed to aggregate threads into their
> preferred LLC, either via the task wake up path or the load balancing
> path. One side effect is that when the preferred LLC is saturated,
> more threads will continue to be stacked on it, degrading the workload's
> latency. A strategy is needed to prevent this aggregation from going too
> far such that the preferred LLC is too overloaded.

So one of the ideas was to extend the preferred llc number to a mask.
Update the preferred mask with (nr_threads / llc_size) bits, indicating
the that many top llc as sorted by occupancy.