Re: [RFC PATCH 0/1] netlink: Netlink process event for cgroup migration

From: Prakash Sangappa

Date: Wed Apr 08 2026 - 23:45:12 EST


Hi Michal,

Thanks for look into this patch proposal.


> On Apr 8, 2026, at 5:54 AM, Michal Koutný <mkoutny@xxxxxxxx> wrote:
>
> Hi Prakash.
>
> On Tue, Apr 07, 2026 at 05:23:38PM +0000, Prakash Sangappa <prakash.sangappa@xxxxxxxxxx> wrote:
>> With cgroup based resource management, it becomes useful for
>> userspace to be notified when a task changes cgroup membership.
>> Unexpected migrations can lead to incorrect resource accounting
>> and enforcement resulting in undesirable behavior or failures.
>> Applications/userspace have to poll /proc to detect changes to
>> cgroup membership, which is inefficient when dealing with a large
>> number of tasks.
>
> You may want to check [1] (and followup discussion).

Will take a look.

>
>> Add a new netlink proc connector event that gets generated when
>> a task migrates between cgroups. This allows applications/tools
>> to monitor cgroup membership changes without periodic polling.
>
> This CN_IDX_PROC netlink API haunts me at night.
> The hook(s) proposed above are IMO more future proof and robust approach
> to the process migration that comes as a surprise (and possibly
> interferes with intended resource management).

Ok, with [1] would there be bpf hooks that can be used for notification
of cgroup migration events? Will take a look.

Thanks,
-Prakash

>
> Thanks,
> Michal
>
> [1] https://lore.kernel.org/all/20260220-work-bpf-namespace-v1-2-866207db7b83@xxxxxxxxxx/