Re: [RFC PATCH v5] mm: retry page faults once under the per-VMA lock
From: Andrew Morton
Date: Fri Aug 14 2026 - 14:51:18 EST
On Fri, 14 Aug 2026 16:53:00 +0800 Hongru Zhang <zhanghongru06@xxxxxxxxx> wrote:
> From: Hongru Zhang <zhanghongru@xxxxxxxxxx>
>
> The per-VMA lock fault path falls back to mmap_lock on VM_FAULT_RETRY.
> When mmap_lock is write-contended, the fallback can reduce page-fault
> throughput.
>
> Add a single retry under the per-VMA lock in the arch fault handler
> instead of adding a new VM_FAULT_* flag.
>
> ...
>
> Swap Throughput (higher is better):
> +--------------+-------------+---------------------------+
> | mmap writers | Vanilla | Patched |
> +--------------+-------------+---------------------------+
> | 0 | 17303.09 /s | 17899.48 /s (+3.4%) |
> +--------------+-------------+---------------------------+
> | 4 | 12596.23 /s | 16095.20 /s (+27.8%) |
> +--------------+-------------+---------------------------+
> | 8 | 0.58 /s | 15420.57 /s (+2658619.0%) |
> +--------------+-------------+---------------------------+
Well.
> With increasing mmap_lock write pressure, Vanilla degrades sharply and
> drops to near zero at eight writers. Patched kernel holds up much better.
Thanks for working on this.
Are you able to help us understand how much effect this change will
have upon any real-world workloads?