Re: [PATCH 2/3 cgroup/for-6.16] sched_ext: Introduce cgroup_lifetime_notifier
From: Tejun Heo
Date: Mon Jun 02 2025 - 13:31:07 EST
Hello,
On Mon, Jun 02, 2025 at 05:07:39PM +0200, Michal Koutný wrote:
> On Wed, May 14, 2025 at 12:44:44AM -0400, Tejun Heo <tj@xxxxxxxxxx> wrote:
> > Other subsystems may make use of the cgroup hierarchy with the cgroup_bpf
> > support being one such example. For such a feature, it's useful to be able
> <snip>
>
> > other uses are planned.
> <snip>
>
> > @@ -5753,6 +5765,15 @@ static struct cgroup *cgroup_create(stru
> > goto out_psi_free;
> > }
> >
> > + ret = blocking_notifier_call_chain_robust(&cgroup_lifetime_notifier,
> > + CGROUP_LIFETIME_ONLINE,
> > + CGROUP_LIFETIME_OFFLINE, cgrp);
>
> This is with cgroup_mutex taken.
>
> Wouldn't it be more prudent to start with atomic or raw notifier chain?
> (To prevent future unwitting expansion of cgroup_mutex.)
This being primarily useful for init/exiting stuff, I think it'd be
reasonable to expect memory allocations. e.g. Even the existing BPF cgroup
support needs sleepable context for percpu_ref init and prog allocations.
If cgroup_mutex gets involved in locking dep loops, it'll light up lockdep,
so I'm not *too* worried.
Thanks.
--
tejun