Re: [RFC PATCH 0/2] mm: separate the fallback to mmap_lock from VM_FAULT_RETRY

From: David Hildenbrand (Arm)

Date: Tue Dec 01 2026 - 06:08:36 EST


On 11/29/26 21:22, Suren Baghdasaryan wrote:
> VM_FAULT_RETRY is returned from the page fault path for two different
> reasons. Usually it means that the fault handler had to drop its lock,
> typically to wait for something, and the fault has to be handled again.
> With per-VMA locks it is also returned when the fault can not be handled
> under the per-VMA lock at all and has to be handled under mmap_lock. The
> architecture fault handlers can not tell these two cases apart, so every
> VM_FAULT_RETRY from a fault handled under the per-VMA lock results in a
> retry under mmap_lock.

I think having a separate return value makes sense.

just wondering, whether something like

VM_FAULT_NEED_MM_LOCK

would be clearer while we are at it.

--
Cheers,

David