Re: [PATCH v3] mm: memcontrol: don't miss processes whose leader has exited in OOM scans
From: Michal Hocko
Date: Mon Nov 23 2026 - 05:11:37 EST
On Sat 21-11-26 15:32:22, Zhan Xusheng wrote:
> Moving the exited leader along with its threads came up on v1, and
> there has been no answer from the cgroup side. cgroup.kill had the
> same case: da13e0e72a73 ("cgroup: fix cgroup.kill for exited thread
> group leader") walks all threads instead of the leaders, and
> 5f4a3f743acc ("cgroup: don't kill migrated processes through their
> exiting threads") then had to keep an exiting thread left behind from
> standing for a process that has moved out. This patch does the same
> for the memcg scan; the second case is what the live_elsewhere check
> covers.
Tejun, is there any strong reason to keep the exiting thread group
leader in the original cgroup? This makes CSS_TASK_ITER_PROCS iteration
really tricky and error prone as above examples show.
--
Michal Hocko
SUSE Labs