From: Tejun Heo Subject: Re: [PATCH v4 4/6] cgroup/cpuset: Allow non-top parent partition root to distribute out all CPUs Date: Thu, 12 Aug 2021 11:51:27 -1000 Message-ID: References: <20210811030607.13824-1-longman@redhat.com> <20210811030607.13824-5-longman@redhat.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=jH45JI3TRK33maJqrgZXXznOLgIkQBFryW79S8eId3M=; b=Y9WHxm/HccEPeJfkiPBSqOtIQdiDsYdt/RUttWpOGC4h8GALHwr5TYVrcHS/FwHdAW brH64YsniZ1m2CNdrbrRALQs4yxFN228FlIYSp3S0S81J4b6QJOTWS/mu0gD20utmJ4x mB0yPjJdiz3mudogXhcCUvzXk7KEW3/afkG4GAVpFUIkWVh+DvpPNLLJu2S0RFYmI34h 2l3Qd9IzJRZjgCQqH93U+FiFNpHfZT5x9yWgcHrcG+V3oXyZa/BN7M+FKmnG3winetMh U2i52F02EYfs7f0/kK4ctk7+orUAr3RLJDZxf9bOxVyu9FtRjPORwymlSEnsMzmX7cmf Rq2Q== Sender: Tejun Heo Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Waiman Long Cc: Zefan Li , Johannes Weiner , Jonathan Corbet , Shuah Khan , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrew Morton , Roman Gushchin , Phil Auld , Peter Zijlstra , Juri Lelli , Frederic Weisbecker , Marcelo Tosatti , Michal =?iso-8859-1?Q?Koutn=FD?= 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