Re: [PATCH v2] memcg: allow exiting tasks to write back data to swap

From: Rik van Riel
Date: Wed Jan 15 2025 - 12:41:36 EST


On Tue, 2025-01-14 at 20:42 +0100, Michal Hocko wrote:
> O
> I do agreee that a memory deadlock is not really proper way to deal
> with
> the issue. I have to admit that my understanding was based on ENOMEM
> being properly propagated out of in kernel user page faults.

It looks like it kind of is.

In case of VM_FAULT_OOM, the page fault code calls
kernelmode_fixup_or_oops(), which a few functions
down calls ex_handler_default(), which advances
regs->ip to the next instruction after the one
that faulted.

Of course, if we have a copy_from_user loop, we
could end up there a bunch of times :)

--
All Rights Reversed.