Thread (5 messages) 5 messages, 2 authors, 2021-10-04
STALE1712d

[PATCH 4/4] cgroup: use parent directly instead of cgroup_parent()

From: Wei Yang <hidden>
Date: 2021-10-04 08:49:45
Also in: lkml
Subsystem: control group (cgroup), the rest · Maintainers: Tejun Heo, Johannes Weiner, Michal Koutný, Linus Torvalds

During cgroup_create(), we are sure who is our parent.

Let's use parent directly instead of fetch it from cgroup hierarchy.

Signed-off-by: Wei Yang <redacted>
---
 kernel/cgroup/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 457353aeb0ca..694b1c7803c2 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5368,7 +5368,7 @@ static struct cgroup *cgroup_create(struct cgroup *parent, const char *name,
 	cgrp->self.serial_nr = css_serial_nr_next++;
 
 	/* allocation complete, commit to creation */
-	list_add_tail_rcu(&cgrp->self.sibling, &cgroup_parent(cgrp)->self.children);
+	list_add_tail_rcu(&cgrp->self.sibling, &parent->self.children);
 	atomic_inc(&root->nr_cgrps);
 	cgroup_get_live(parent);
 
-- 
2.23.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help