Re: [PATCH] cgroup: reject controller re-enable while css teardown is pending

From: Tejun Heo

Date: Wed Sep 02 2026 - 19:08:54 EST


Hello,

On Tue, Sep 01, 2026 at 09:23:42AM +0800, Tao Yu wrote:
> Stop draining offline csses from subtree_control and cgroup.type writes.
> Instead, reject the operation with -EBUSY if it would reuse a subsystem which
> still has dying csses in the target subtree.

Failing the re-enable isn't the right trade-off. "-cpu" followed by "+cpu"
has always succeeded eventually, and nr_dying_subsys stays non-zero until
the css is released, so it also counts removed cgroups and offlined but
still pinned csses. The -EBUSY would persist well past the actual conflict.

The writer shouldn't be sitting in D state waiting for exiting tasks in the
first place, so I posted a patchset which makes the drain interruptible
instead:

https://lore.kernel.org/all/20260902230313.530839-1-tj@xxxxxxxxxx/

Thanks.

--
tejun