Re: [PATCH v3 1/2] mm/filemap: count only the faulting address as a mmap hit
From: Vishal Moola
Date: Sun May 10 2026 - 08:53:18 EST
On Tue, Apr 28, 2026 at 01:59:43AM +0000, fujunjie wrote:
> filemap_map_pages() reduces file->f_ra.mmap_miss when fault-around maps
> folios that are already present in the page cache. That hit accounting
> is too generous because fault-around can install PTEs around the
> faulting address even though the fault only proves that the faulting
> address was accessed.
>
> Move the mmap_miss update back into filemap_map_pages(), drop the
> mmap_miss argument from the helper functions, and decrement mmap_miss
> only when the helper return value shows that the faulting address was
> mapped. Keep the existing workingset-folio behavior unchanged.
>
> Signed-off-by: fujunjie <fujunjie1@xxxxxx>
> ---
Reviewed-by: Vishal Moola <vishal.moola@xxxxxxxxx>