]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
cgroup: use cached local variable parent in for loop
authorMiaohe Lin <linmiaohe@huawei.com>
Sat, 15 Jul 2023 03:08:29 +0000 (11:08 +0800)
committerTejun Heo <tj@kernel.org>
Mon, 17 Jul 2023 18:34:41 +0000 (08:34 -1000)
Use local variable parent to initialize iter tcgrp in for loop so the size
of cgroup.o can be reduced by 64 bytes. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c

index 30c9c2503ccf1bdebbd6110a6e9a636a20204ae8..e9a62de3faf9b2adf8e1cd961853c9a906da12c7 100644 (file)
@@ -5894,7 +5894,7 @@ static int cgroup_destroy_locked(struct cgroup *cgrp)
                parent->nr_threaded_children--;
 
        spin_lock_irq(&css_set_lock);
-       for (tcgrp = cgroup_parent(cgrp); tcgrp; tcgrp = cgroup_parent(tcgrp)) {
+       for (tcgrp = parent; tcgrp; tcgrp = cgroup_parent(tcgrp)) {
                tcgrp->nr_descendants--;
                tcgrp->nr_dying_descendants++;
                /*