On Wed, Aug 11, 2021 at 02:46:24PM -0400, Waiman Long wrote: > On 8/11/21 2:21 PM, Tejun Heo wrote: > > On Wed, Aug 11, 2021 at 02:18:17PM -0400, Waiman Long wrote: > > > I don't think that is true. A task can reside anywhere in the cgroup > > > hierarchy. I have encountered no problem moving tasks around. > > Oh, that shouldn't be happening with controllers enabled. Can you please > > share a repro? > > I have done further testing. Enabling controllers won't prohibit moving a > task into a parent cgroup as long as the child cgroups have no tasks. Once Should be "as long as there's no child cgroups". root@test /s/f/cgroup# mkdir test root@test /s/f/cgroup# mkdir -p test/A root@test /s/f/cgroup# echo +io > test/cgroup.subtree_control root@test /s/f/cgroup# echo $fish_pid > test/cgroup.procs write: Device or resource busy > the child cgroup has task, moving another task to the parent is not allowed > (-EBUSY). Similarly if a parent cgroup has tasks, you can't put new tasks > into the child cgroup. I don't realize that we have such constraints as I You can't enable controller from a populated cgroup: root@test /s/f/cgroup# mkdir test root@test /s/f/cgroup# echo +io > test/cgroup.subtree_control root@test /s/f/cgroup# echo $fish_pid > test/cgroup.procs > usually do my testing with a cgroup hierarchy with no tasks initially. > Anyway, a new lesson learned. The invariant is that from each controller's POV, all cgroups with processes in them are leaves. This is all pretty well documented in cgroup-v2.rst. Thanks. -- tejun