* [PATCH v2 -next] cgroup: don't call cgroup1_pidlist_destroy_all() for v2
@ 2024-04-18 2:19 Xiu Jianfeng
2024-04-18 15:57 ` Tejun Heo
0 siblings, 1 reply; 2+ messages in thread
From: Xiu Jianfeng @ 2024-04-18 2:19 UTC (permalink / raw)
To: tj, lizefan.x, hannes; +Cc: cgroups, linux-kernel
From: Xiu Jianfeng <xiujianfeng@huawei.com>
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>
---
v2: move the test to the caller
---
kernel/cgroup/cgroup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2 -next] cgroup: don't call cgroup1_pidlist_destroy_all() for v2
2024-04-18 2:19 [PATCH v2 -next] cgroup: don't call cgroup1_pidlist_destroy_all() for v2 Xiu Jianfeng
@ 2024-04-18 15:57 ` Tejun Heo
0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-04-18 15:57 UTC (permalink / raw)
To: Xiu Jianfeng; +Cc: lizefan.x, hannes, cgroups, linux-kernel
On Thu, Apr 18, 2024 at 02:19:30AM +0000, Xiu Jianfeng wrote:
> From: Xiu Jianfeng <xiujianfeng@huawei.com>
>
> 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>
Applied to cgroup/for-6.10.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-18 15:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-18 2:19 [PATCH v2 -next] cgroup: don't call cgroup1_pidlist_destroy_all() for v2 Xiu Jianfeng
2024-04-18 15:57 ` Tejun Heo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®