summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXiu Jianfeng <xiujianfeng@huawei.com>2024-04-18 02:19:30 +0000
committerTejun Heo <tj@kernel.org>2024-04-18 05:56:58 -1000
commit15a0b5fe1ad6fbecfa6517750718089e12ee8344 (patch)
treeb5431e2ae5d4bbc459bca5f67c19edca511b54f5
parenta6b8daba00e6703b728933d2ec24e6d1ee5d5ec0 (diff)
downloadlinux-stable-15a0b5fe1ad6fbecfa6517750718089e12ee8344.tar.gz
linux-stable-15a0b5fe1ad6fbecfa6517750718089e12ee8344.tar.bz2
linux-stable-15a0b5fe1ad6fbecfa6517750718089e12ee8344.zip
cgroup: don't call cgroup1_pidlist_destroy_all() for v2
Currently cgroup1_pidlist_destroy_all() will be called when releasing cgroup even if the cgroup is on default hierarchy, however it doesn't make any sense for v2 to destroy pidlist of v1. Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com> Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r--kernel/cgroup/cgroup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index a66c088c851c..e32b6972c478 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -5368,7 +5368,8 @@ static void css_free_rwork_fn(struct work_struct *work)
} else {
/* cgroup free path */
atomic_dec(&cgrp->root->nr_cgrps);
- cgroup1_pidlist_destroy_all(cgrp);
+ if (!cgroup_on_dfl(cgrp))
+ cgroup1_pidlist_destroy_all(cgrp);
cancel_work_sync(&cgrp->release_agent_work);
bpf_cgrp_storage_free(cgrp);