Re: [RFC PATCH v3] mm: retry page faults under per-VMA lock when mmap_lock is not required

From: David Hildenbrand (Arm)

Date: Tue Jul 07 2026 - 10:03:56 EST


On 6/26/26 09:50, Hongru Zhang wrote:
> From: Hongru Zhang <zhanghongru@xxxxxxxxxx>
>
> Currently, when a page fault returns VM_FAULT_RETRY under the per-VMA
> lock due to folio_lock() failing, mainly because the folio is under
> I/O, the architecture fault handler unconditionally falls back to
> retrying with mmap_lock. This leads to mmap_lock contention.
>
> This patch introduces VM_FAULT_RETRY_HARD to mark the paths that
> require mmap_lock.

Really sorry, but what a bad name :)

Can we just embed the "no VMA lock" or "MMAP_LOCK" in the name somehow?

VM_FAULT_RETRY_NEED_MMAP_LOCK
VM_FAULT_RETRY_NO_VMA_LOCK


Something like that?


Also, we should document what the new flag means, and how it, for example, is
always accompanied by VM_FAULT_RETRY.

Best to be as clear as possible on the intended semantics.

--
Cheers,

David