Skip to content

Commit 15a0b5f

Browse files
Xiu Jianfenghtejun
authored andcommitted
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 <[email protected]> Signed-off-by: Tejun Heo <[email protected]>
1 parent a6b8dab commit 15a0b5f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

kernel/cgroup/cgroup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5368,7 +5368,8 @@ static void css_free_rwork_fn(struct work_struct *work)
53685368
} else {
53695369
/* cgroup free path */
53705370
atomic_dec(&cgrp->root->nr_cgrps);
5371-
cgroup1_pidlist_destroy_all(cgrp);
5371+
if (!cgroup_on_dfl(cgrp))
5372+
cgroup1_pidlist_destroy_all(cgrp);
53725373
cancel_work_sync(&cgrp->release_agent_work);
53735374
bpf_cgrp_storage_free(cgrp);
53745375

0 commit comments

Comments
 (0)