aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorGlauber Costa <glommer@parallels.com>2012-11-30 08:31:23 -0500
committerTejun Heo <tj@kernel.org>2012-11-30 10:11:07 -0500
commit1f869e8711d18aaf6e2979922bc9377ad394b82f (patch)
treeb6da5d097987c745d6ff970efefec2225ca85bb5 /kernel
parent9718ceb3431acdeee9bdec5c18e18266333970aa (diff)
cgroup: warn about broken hierarchies only after css_online
If everything goes right, it shouldn't really matter if we are spitting this warning after css_alloc or css_online. If we fail between then, there are some ill cases where we would previously see the message and now we won't (like if the files fail to be created). I believe it really shouldn't matter: this message is intended in spirit to be shown when creation succeeds, but with insane settings. Signed-off-by: Glauber Costa <glommer@parallels.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cgroup.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 46dcdbd7485b..b186a7e25b0a 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4151,15 +4151,6 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
4151 if (err) 4151 if (err)
4152 goto err_free_all; 4152 goto err_free_all;
4153 } 4153 }
4154
4155 if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
4156 parent->parent) {
4157 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",
4158 current->comm, current->pid, ss->name);
4159 if (!strcmp(ss->name, "memory"))
4160 pr_warning("cgroup: \"memory\" requires setting use_hierarchy to 1 on the root.\n");
4161 ss->warned_broken_hierarchy = true;
4162 }
4163 } 4154 }
4164 4155
4165 /* 4156 /*
@@ -4188,6 +4179,15 @@ static long cgroup_create(struct cgroup *parent, struct dentry *dentry,
4188 err = online_css(ss, cgrp); 4179 err = online_css(ss, cgrp);
4189 if (err) 4180 if (err)
4190 goto err_destroy; 4181 goto err_destroy;
4182
4183 if (ss->broken_hierarchy && !ss->warned_broken_hierarchy &&
4184 parent->parent) {
4185 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",
4186 current->comm, current->pid, ss->name);
4187 if (!strcmp(ss->name, "memory"))
4188 pr_warning("cgroup: \"memory\" requires setting use_hierarchy to 1 on the root.\n");
4189 ss->warned_broken_hierarchy = true;
4190 }
4191 } 4191 }
4192 4192
4193 err = cgroup_populate_dir(cgrp, true, root->subsys_mask); 4193 err = cgroup_populate_dir(cgrp, true, root->subsys_mask);