From mboxrd@z Thu Jan 1 00:00:00 1970 From: Li Zefan Subject: Re: [PATCH v4 cgroup/for-3.7] cgroup: mark subsystems with broken hierarchy support and whine if cgroups are nested for them Date: Fri, 14 Sep 2012 15:48:16 +0800 Message-ID: <5052E140.8000704@huawei.com> References: <20120913183402.GG7677@google.com> <20120913192058.GH7677@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20120913192058.GH7677-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Tejun Heo Cc: Neil Horman , "Serge E. Hallyn" , containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Michal Hocko , Ingo Molnar , Paul Mackerras , "Aneesh Kumar K.V" , Arnaldo Carvalho de Melo , Johannes Weiner , Thomas Graf , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Paul Turner , Vivek Goyal 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 > Cc: Michal Hocko > Cc: Li Zefan > Cc: Glauber Costa > Cc: Peter Zijlstra > Cc: Paul Turner > Cc: Johannes Weiner > Cc: Thomas Graf > Cc: Serge E. Hallyn > Cc: Vivek Goyal > Cc: Paul Mackerras > Cc: Ingo Molnar > Cc: Arnaldo Carvalho de Melo > Cc: Neil Horman > Cc: Aneesh Kumar K.V Acked-by: Li Zefan