diff options
author | Tejun Heo <tj@kernel.org> | 2017-08-03 00:39:38 +0200 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2017-08-03 00:39:38 +0200 |
commit | 13d82fb77abb9625f3ca74f5c4cbedde0f412f01 (patch) | |
tree | 70307b2105a576f8aaee0bf48344bc61e404dbf7 /kernel/cgroup | |
parent | cgroup: re-use the parent pointer in cgroup_destroy_locked() (diff) | |
download | linux-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.c | 2 |
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; |