Re: [RFC PATCH v2 0/3] BPF-based per-cgroup NUMA balancing mode selection
From: Tejun Heo
Date: Tue Oct 13 2026 - 14:08:40 EST
Hello,
On Tue, Oct 13, 2026 at 10:16:32AM +0800, Yafang Shao wrote:
> Part of the consults are keyed on struct folio rather than struct
> task_struct: the folio surface answers from the folio's memcg, the
> owner's request, not the touching task's.
Right, and I take the prctl() point too. It's stable uAPI and too rigid
a bar for this.
My suggestion is to start smaller. The op doesn't compute anything
from its inputs. It returns a fixed mode per cgroup, and you don't
need struct_ops for that.
A kfunc that takes a cgid and a value would do: -1 for the system
setting, otherwise the existing NUMA_BALANCING_* bitmask stored per
cgroup. Task callsites read it through the task's cgroup, folio
callsites through folio_memcg(). Same capability for the use case in
the cover letter, a per-cgroup field and minimal plumbing, and the
kfunc can grow later if a real decision-time policy shows up.
Thanks.
--
tejun