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

Vivek Goyal
2012-09-13T19:41:11Z

On Thu, Sep 13, 2012 at 12:20:58PM -0700, Tejun Heo wrote:

[..]
> +
> + if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
> + parent->parent) {
> + pr_warning("cgroup: %s (%d) created nested cgroup for controller \"%s\" which has incomplete hierarchy support. Nested cgroups may change behavior in the future.\n",
> + current->comm, current->pid, ss->name);
> + if (!strcmp(ss->name, "memory"))
> + pr_warning("cgroup: \"memory\" requires setting use_hierarchy to 1 on the root.\n");
> + ss->warned_broken_hierarchy = true;
> + }

Hi Tejun,

Had one more question. So this warning pops up if parent->parent is set.
So first level of cgroup creation is allowed but not the second level
one?

I think for blkio controller, first level of creation itself is wrong if
hierarchy is not supported.

root
/ | \
T1 T2 G1

So T1 and T2 are tasks and G1 is the created cgroup. Now if we are
expecting hierarchical controller then like cpu controller, T1, T2 and
G1 should be considered at same level and disk bandwidth should be
divided equally between T1, T2 and G1.

But currently blkio controller looks at them as follows.

pivot
/ \
root G1
/ \
T1 T2
and divides bandwidth between root and G1 equally (if weights are equal).

Now if you don't warn about first level creation and later change to default
hierarchical controller, anyway you will change the behavior underneath
(even if user space creates only one level of cgroup).

Point being, cgroup fs does not allow us to create flat hierarchy. So
warning about second level creation and beyond does not help much and
behavior underneath will change anyway(even for first level of creation).

Thanks
Vivek