aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2017-08-02 18:39:38 -0400
committerTejun Heo <tj@kernel.org>2017-08-02 18:39:38 -0400
commit13d82fb77abb9625f3ca74f5c4cbedde0f412f01 (patch)
tree70307b2105a576f8aaee0bf48344bc61e404dbf7
parent5a621e6c958e057c727a30c502f28bf2bc04adfd (diff)
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>
-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,
1311 1311
1312 if (cset == &init_css_set) { 1312 if (cset == &init_css_set) {
1313 res = &root->cgrp; 1313 res = &root->cgrp;
1314 } else if (root == &cgrp_dfl_root) {
1315 res = cset->dfl_cgrp;
1314 } else { 1316 } else {
1315 struct cgrp_cset_link *link; 1317 struct cgrp_cset_link *link;
1316 1318