cgroup: re-use the parent pointer in cgroup_destroy_locked()

This change “cgroup: re-use the parent pointer in cgroup_destroy_locked()” in Linux kernel is authored by Roman Gushchin <guro [at]> on Wed Aug 2 17:55:32 2017 +0100.

cgroup: re-use the parent pointer in cgroup_destroy_locked()

As we already have a pointer to the parent cgroup in
cgroup_destroy_locked(), we don't need to calculate it again
to pass as an argument for cgroup1_check_for_release().

Signed-off-by: Roman Gushchin <>
Suggested-by: Tejun Heo <>
Signed-off-by: Tejun Heo <>
Cc: Zefan Li <>
Cc: Waiman Long <>
Cc: Johannes Weiner <>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 5a621e6.

There are 2 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 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 a06755a..92e5997 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5022,7 +5022,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
-	cgroup1_check_for_release(cgroup_parent(cgrp));
+	cgroup1_check_for_release(parent);
 	/* put the base reference */

The commit for this change in Linux stable tree is 5a621e6 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *