Messages in this thread Patch in this message |  | | From | Wei Yang <> | | Subject | [PATCH 4/4] cgroup: use parent directly instead of cgroup_parent() | | Date | Mon, 4 Oct 2021 08:49:28 +0000 |
| |
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 <richard.weiyang@gmail.com> --- 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
|  |