Re: [PATCH 0/6] sched: Expose writable interface for preferred CPUs mask

From: Maxim Kuvyrkov

Date: Mon Nov 09 2026 - 22:23:28 EST


> On Nov 2, 2026, at 08:21, Yury Norov <ynorov@xxxxxxxxxx> wrote:
>
> The preferred CPU mask currently lets the steal governor reduce vCPU
> demand when physical CPUs are contended. This series adds manual control,
> opening more use cases.
>
> For example, setting CPUs aside for selected fair tasks at runtime while
> steering other fair tasks toward the remaining CPUs.

Hi Yury,

I've been trying to do this with crutches in user-space for a long time. Thanks for implementing this in the kernel, and with a convenient user interface.

>
> A user can mark a CPU non-preferred and pin a workload to it. Fair tasks
> whose affinity includes preferred CPUs are steered away, while tasks
> whose allowed CPUs contain no preferred CPU can still run there. The CPU
> stays online, task affinity is preserved, and the selection can be
> reversed without rebooting:
>
> # rmmod steal_governor
> # echo 0 > /sys/devices/system/cpu/cpu3/preferred
> # taskset -c 3 ./my_workload
> # echo 1 > /sys/devices/system/cpu/cpu3/preferred

My use-case (being a compiler optimization engineer) is to pin benchmarks to specific cores, and stop the system from using those cores even when the cores are idle. This prevents L1/L2 cache pollution and makes performance numbers more stable.

Thanks!

--
Maxim Kuvyrkov
Garden City Compilers