Re: [RFC PATCH 0/1] netlink: Netlink process event for cgroup migration
From: Michal Koutný
Date: Wed Apr 08 2026 - 08:58:50 EST
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).
> 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).
Thanks,
Michal
[1] https://lore.kernel.org/all/20260220-work-bpf-namespace-v1-2-866207db7b83@xxxxxxxxxx/
Attachment:
signature.asc
Description: PGP signature