From: Miaohe Lin <linmiaohe@huawei.com> To: <tj@kernel.org>, <lizefan@huawei.com>, <hannes@cmpxchg.org>, <cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org> Cc: <linmiaohe@huawei.com>, <mingfangsen@huawei.com> Subject: [PATCH] cgroup: short-circuit current_cgns_cgroup_from_root() on the default hierarchy Date: Sun, 29 Sep 2019 16:06:58 +0800 [thread overview] Message-ID: <20190929080658.11430-1-linmiaohe@huawei.com> (raw) Like commit 13d82fb77abb ("cgroup: short-circuit cset_cgroup_from_root() on the default hierarchy"), short-circuit current_cgns_cgroup_from_root() on the default hierarchy. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- kernel/cgroup/cgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 8be1da1ebd9a..b90c8b200aa2 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1374,6 +1374,8 @@ current_cgns_cgroup_from_root(struct cgroup_root *root) cset = current->nsproxy->cgroup_ns->root_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; -- 2.21.GIT
WARNING: multiple messages have this Message-ID (diff)
From: Miaohe Lin <linmiaohe@huawei.com> To: tj@kernel.org, lizefan@huawei.com, hannes@cmpxchg.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linmiaohe@huawei.com, mingfangsen@huawei.com Subject: [PATCH] cgroup: short-circuit current_cgns_cgroup_from_root() on the default hierarchy Date: Sun, 29 Sep 2019 16:06:58 +0800 [thread overview] Message-ID: <20190929080658.11430-1-linmiaohe@huawei.com> (raw) Like commit 13d82fb77abb ("cgroup: short-circuit cset_cgroup_from_root() on the default hierarchy"), short-circuit current_cgns_cgroup_from_root() on the default hierarchy. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- kernel/cgroup/cgroup.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 8be1da1ebd9a..b90c8b200aa2 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1374,6 +1374,8 @@ current_cgns_cgroup_from_root(struct cgroup_root *root) cset = current->nsproxy->cgroup_ns->root_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; -- 2.21.GIT
next reply other threads:[~2019-09-29 8:23 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-29 8:06 Miaohe Lin [this message] 2019-09-29 8:06 ` [PATCH] cgroup: short-circuit current_cgns_cgroup_from_root() on the default hierarchy Miaohe Lin 2019-10-07 14:04 ` Tejun Heo
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20190929080658.11430-1-linmiaohe@huawei.com \ --to=linmiaohe@huawei.com \ --cc=cgroups@vger.kernel.org \ --cc=hannes@cmpxchg.org \ --cc=linux-kernel@vger.kernel.org \ --cc=lizefan@huawei.com \ --cc=mingfangsen@huawei.com \ --cc=tj@kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.