Re: [PATCH v3 3/4] mm/sparse-vmemmap: Fix DAX vmemmap accounting with optimization
From: Oscar Salvador
Date: Tue Apr 21 2026 - 00:00:36 EST
On Tue, Apr 21, 2026 at 10:20:43AM +0800, Muchun Song wrote:
> When vmemmap optimization is enabled for DAX, the nr_memmap_pages
> counter in /proc/vmstat is incorrect. The current code always accounts
> for the full, non-optimized vmemmap size, but vmemmap optimization
> reduces the actual number of vmemmap pages by reusing tail pages. This
> causes the system to overcount vmemmap usage, leading to inaccurate
> page statistics in /proc/vmstat.
>
> Fix this by introducing section_vmemmap_pages(), which returns the exact
> vmemmap page count for a given pfn range based on whether optimization
> is in effect.
>
> Fixes: 15995a352474 ("mm: report per-page metadata information")
> Signed-off-by: Muchun Song <songmuchun@xxxxxxxxxxxxx>
> Acked-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Acked-by: Oscar Salvador <osalvador@xxxxxxx>
--
Oscar Salvador
SUSE Labs