summaryrefslogtreecommitdiffstats
path: root/kernel/cgroup
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2017-08-03 00:39:38 +0200
committerTejun Heo <tj@kernel.org>2017-08-03 00:39:38 +0200
commit13d82fb77abb9625f3ca74f5c4cbedde0f412f01 (patch)
tree70307b2105a576f8aaee0bf48344bc61e404dbf7 /kernel/cgroup
parentcgroup: re-use the parent pointer in cgroup_destroy_locked() (diff)
downloadlinux-13d82fb77abb9625f3ca74f5c4cbedde0f412f01.tar.xz
linux-13d82fb77abb9625f3ca74f5c4cbedde0f412f01.zip
cgroup: short-circuit cset_cgroup_from_root() on the default hierarchy
Each css_set directly points to the default cgroup it belongs to, so there's no reason to walk the cgrp_links list on the default hierarchy. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'kernel/cgroup')
-rw-r--r--kernel/cgroup/cgroup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 92e599796220..f5ca55db1fe1 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1311,6 +1311,8 @@ static struct cgroup *cset_cgroup_from_root(struct css_set *cset,
if (cset == &init_css_set) {
res = &root->cgrp;
+ } else if (root == &cgrp_dfl_root) {
+ res = cset->dfl_cgrp;
} else {
struct cgrp_cset_link *link;