[PATCH v4 cgroup/for-3.7] cgroup: mark subsystems with broken hierarchy support and whine if cgroups are nested for them

Li Zefan lizefan at huawei.com
Fri Sep 14 07:48:16 UTC 2012


On 2012/9/14 3:20, Tejun Heo wrote:
> Currently, cgroup hierarchy support is a mess.  cpu related subsystems
> behave correctly - configuration, accounting and control on a parent
> properly cover its children.  blkio and freezer completely ignore
> hierarchy and treat all cgroups as if they're directly under the root
> cgroup.  Others show yet different behaviors.
> 
> These differing interpretations of cgroup hierarchy make using cgroup
> confusing and it impossible to co-mount controllers into the same
> hierarchy and obtain sane behavior.
> 
> Eventually, we want full hierarchy support from all subsystems and
> probably a unified hierarchy.  Users using separate hierarchies
> expecting completely different behaviors depending on the mounted
> subsystem is deterimental to making any progress on this front.
> 
> This patch adds cgroup_subsys.broken_hierarchy and sets it to %true
> for controllers which are lacking in hierarchy support.  The goal of
> this patch is two-fold.
> 
> * Move users away from using hierarchy on currently non-hierarchical
>   subsystems, so that implementing proper hierarchy support on those
>   doesn't surprise them.
> 
> * Keep track of which controllers are broken how and nudge the
>   subsystems to implement proper hierarchy support.
> 
> For now, start with a single warning message.  We can whine louder
> later on.
> 
> v2: Fixed a typo spotted by Michal. Warning message updated.
> 
> v3: Updated memcg part so that it doesn't generate warning in the
>     cases where .use_hierarchy=false doesn't make the behavior
>     different from root.use_hierarchy=true.  Fixed a typo spotted by
>     Glauber.
> 
> v4: Check ->broken_hierarchy after cgroup creation is complete so that
>     ->create() can affect the result per Michal.  Dropped unnecessary
>     memcg root handling per Michal.
> 
> Signed-off-by: Tejun Heo <tj at kernel.org>
> Cc: Michal Hocko <mhocko at suse.cz>
> Cc: Li Zefan <lizefan at huawei.com>
> Cc: Glauber Costa <glommer at parallels.com>
> Cc: Peter Zijlstra <peterz at infradead.org>
> Cc: Paul Turner <pjt at google.com>
> Cc: Johannes Weiner <hannes at cmpxchg.org>
> Cc: Thomas Graf <tgraf at suug.ch>
> Cc: Serge E. Hallyn <serue at us.ibm.com>
> Cc: Vivek Goyal <vgoyal at redhat.com>
> Cc: Paul Mackerras <paulus at samba.org>
> Cc: Ingo Molnar <mingo at redhat.com>
> Cc: Arnaldo Carvalho de Melo <acme at ghostprotocols.net>
> Cc: Neil Horman <nhorman at tuxdriver.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>

Acked-by: Li Zefan <lizefan at huawei.com>



More information about the Containers mailing list