]> www.infradead.org Git - users/jedix/linux-maple.git/commit
cgroup: avoid the unnecessary list_add(dying_tasks) in cgroup_exit()
authorOleg Nesterov <oleg@redhat.com>
Mon, 17 Jun 2024 14:31:52 +0000 (16:31 +0200)
committerTejun Heo <tj@kernel.org>
Wed, 19 Jun 2024 17:18:41 +0000 (07:18 -1000)
commit6fe960147e08e931dda1ef325dc69320e544aa73
tree53886297790fccbbd59f6a59026bd52447b83a90
parent1805c1729f52edaa021288473b09f9c7f74fb1ca
cgroup: avoid the unnecessary list_add(dying_tasks) in cgroup_exit()

cgroup_exit() needs to do this only if the exiting task is a leader and it
is not the last live thread.  The patch doesn't use delay_group_leader(),
atomic_read(signal->live) matches the code css_task_iter_advance() more.

cgroup_release() can now check list_empty(task->cg_list) before it takes
css_set_lock and calls ss_set_skip_task_iters().

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c