Re: [PATCH v2 01/13] mm/mmap: free gathered pages before MMF_OOM_SKIP

From: Chris Down

Date: Sat Nov 14 2026 - 14:57:12 EST


Hi Lorenzo,

Thanks! I've tested this with memcg OOMs where one kill is enough to get
back under the limit, and with it the second kill is gone.

It's probably worth knowing that for a memcg OOM this also needs my
css_task_iter fix [1], which is in mm-hotfixes-unstable. Without it the
memcg task scan stops seeing the victim once its last thread starts to
exit, so oom_evaluate_task() never gets as far as checking MMF_OOM_SKIP
for it.

The test I used for this has a 48M memcg with a 30M task and a 1M task
in it, and then a third task in there faults in 26M, so one kill should
be enough. Out of 300 rounds of that, I got a second kill in 299 with
neither patch, 277 with only this one, 147 with only that one, and none
with both.

[1] https://lore.kernel.org/r/avA1wXhTMs9eY2NF@xxxxxxxxxxxxxx

Reviewed-by: Chris Down <chris@xxxxxxxxxxxxxx>
Tested-by: Chris Down <chris@xxxxxxxxxxxxxx>

Chris