[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YRWX3z6Nl41GsXR8@slm.duckdns.org>
Date: Thu, 12 Aug 2021 11:51:27 -1000
From: Tejun Heo <tj@...nel.org>
To: Waiman Long <llong@...hat.com>
Cc: Zefan Li <lizefan.x@...edance.com>,
Johannes Weiner <hannes@...xchg.org>,
Jonathan Corbet <corbet@....net>,
Shuah Khan <shuah@...nel.org>, cgroups@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kselftest@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Roman Gushchin <guro@...com>, Phil Auld <pauld@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Frederic Weisbecker <frederic@...nel.org>,
Marcelo Tosatti <mtosatti@...hat.com>,
Michal Koutný <mkoutny@...e.com>
Subject: Re: [PATCH v4 4/6] cgroup/cpuset: Allow non-top parent partition
root to distribute out all CPUs
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@...t /s/f/cgroup# mkdir test
root@...t /s/f/cgroup# mkdir -p test/A
root@...t /s/f/cgroup# echo +io > test/cgroup.subtree_control
root@...t /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@...t /s/f/cgroup# mkdir test
root@...t /s/f/cgroup# echo +io > test/cgroup.subtree_control
root@...t /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
Powered by blists - more mailing lists