Re: [PATCH v2] sched/numa: Introduce per cgroup numa balance control

From: Li Zhe

Date: Mon Oct 12 2026 - 23:17:31 EST


On Wed, 25 Jun 2025 12:19:35 +0000, mkoutny@xxxxxxxx wrote:
> The balancing works with task granularity already and this new attribute
> is not much of a resource to control.
> Have you considered a per-task attribute? (sched_setattr(), prctl() or
> similar) That one could be inherited and respective cgroups would be
> seeded with a process with intended values. And cpuset could be
> traditionally used to restrict the scope of balancing of such tasks.
>
> WDYT?

Following this direction, I posted a per-process/thread-group prctl()
series for automatic NUMA balancing control:

https://lore.kernel.org/all/20260908122446.56708-1-lizhe.67@xxxxxxxxxxxxx/

The series keeps kernel.numa_balancing as the global hard-off switch and
uses a weak two-state process setting: disable to opt out, enable to
allow participation when the global sysctl and memory policy allow it.
The configured mode is stored in signal_struct, so CLONE_THREAD threads
share it, fork inherits it, and exec preserves it. cpuset and memory
policy still define the placement domain and VMA eligibility.

This is intended to cover the use case raised in this thread without
adding a cgroup-local NUMA balancing resource knob. Could you please have
a look and let me know whether this matches the direction you had in
mind, or whether you would prefer a different ABI such as sched_setattr()?

If the direction looks acceptable, I would also appreciate guidance on
whether the current series has any remaining blockers for being picked
up.

Thanks,
Zhe