linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cgroup: short-circuit current_cgns_cgroup_from_root() on the default hierarchy
@ 2019-09-29  8:06 Miaohe Lin
  2019-10-07 14:04 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Miaohe Lin @ 2019-09-29  8:06 UTC (permalink / raw)
  To: tj, lizefan, hannes, cgroups, linux-kernel; +Cc: linmiaohe, mingfangsen

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] cgroup: short-circuit current_cgns_cgroup_from_root() on the default hierarchy
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2019-10-07 14:04 UTC (permalink / raw)
  To: Miaohe Lin; +Cc: lizefan, hannes, cgroups, linux-kernel, mingfangsen

On Sun, Sep 29, 2019 at 04:06:58PM +0800, Miaohe Lin wrote:
> 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>

Applied to cgroup/for-5.5.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-07 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).