Re: [PATCH] mm: memcontrol: don't miss processes whose leader has exited in OOM scans
From: Michal Hocko
Date: Fri Nov 13 2026 - 03:51:21 EST
On Mon 02-11-26 19:40:29, Zhan Xusheng wrote:
> Hi Michal,
>
> This is v1. v2 [1] reworked the check, but your questions apply to
> both.
>
> On Mon, Nov 02, 2026 at 11:12:42AM +0100, Michal Hocko wrote:
> > Is this a desirable/intended behavior? Shouldn't we move the dead leader
> > along with the rest?
>
> Userspace sees it too. After writing the PID of such a process to
> dst/cgroup.procs:
>
> src: cgroup.procs = 85 cgroup.threads = (empty)
> dst: cgroup.procs = (empty) cgroup.threads = 86 87
>
> Moving the leader would fix that, and memcg would then need no change,
> as the PROCS walk already returns a dying leader with live threads.
> The catch is that the leader has already gone through
> cgroup_task_dead() and is still accounted by controllers: pids, for
> one, uncharges it through task_css() when it is reaped, so the move
> would also have to transfer its pids charge. Tejun, would that be
> acceptable in the core?
Do we have any conclusion on this?
[...]
> [1] https://lore.kernel.org/all/20261027144016.2582880-1-zhanxusheng1024@xxxxxxxxx/
>
> Thanks,
> Zhan Xusheng
--
Michal Hocko
SUSE Labs