Re: [PATCH REPOST RFC cgroup/for-3.7] cgroup: mark subsystems withbroken hierarchy support and whine if cgroups are nested for them

From: Tejun Heo
Date: Tue Sep 11 2012 - 13:07:43 EST


Hello, Michal.

On Tue, Sep 11, 2012 at 12:04:33PM +0200, Michal Hocko wrote:
> > cgroup_unlock();
> > @@ -4953,6 +4958,7 @@ mem_cgroup_create(struct cgroup *cont)
> > &per_cpu(memcg_stock, cpu);
> > INIT_WORK(&stock->work, drain_local_stock);
> > }
> > + mem_cgroup_subsys.broken_hierarchy = !memcg->use_hierarchy;
>
> Hmmm, this will warn even if we have
> root (default use_hierarchy=0)
> \
> A (use_hierarchy=1)
> \
> B <- here
>
> which is unfortunate because it will add a noise to a reasonable
> configuration.

I suppose you're talking about having root group not performing any
accounting and/or control? I suppose such could be a valid use case
(is it really necessary tho?) but I don't think .use_hierarchy is the
right interface for that. If it's absolutely necessary, I think it
should be a root-only flag (even if that ends up using the same code
path). Eventually, we really want to kill .use_hierarchy, or at least
make it to RO 1. As it's currently defined, it's just way too
confusing.

> > hotcpu_notifier(memcg_cpu_hotplug_callback, 0);
> > } else {
> > parent = mem_cgroup_from_cont(cont->parent);
> > --- a/net/core/netprio_cgroup.c
> > +++ b/net/core/netprio_cgroup.c
> > @@ -330,7 +330,17 @@ struct cgroup_subsys net_prio_subsys = {
> > .subsys_id = net_prio_subsys_id,
> > #endif
> > .base_cftypes = ss_files,
> > - .module = THIS_MODULE
> > + .module = THIS_MODULE,
> > +
> > + /*
> > + * net_prio has artificial limit on the number of cgroups and
> > + * disallows nesting making it impossible to co-mount it with other
> > + * hierarchical subsystems. Remove the artificially low PRIOIDX_SZ
> > + * limit and properly nest configuration such that children follow
> > + * their parents' configurations by default and are allowed to
> > + * override and remove the following.
> > + */
> > + .broken_hierarchy = trye,
>
> typo

Heh, I thought I enabled all controllers. Thanks. :)

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/