Re: [RFC PATCH 5/7] mm: Make /proc/pid/smaps use the new generic pagewalk API

Oscar Salvador
2026-04-13T14:31:55Z

On Mon, Apr 13, 2026 at 07:18:00AM -0700, Usama Arif wrote:

> The old smap_gather_stats had special handling for shmem swap
> accounting. For shared or readonly shmem mappings it used
> shmem_swap_usage() to efficiently account swapped-out shmem pages.
> For private writable shmem mappings it used smaps_pte_hole() via
> smaps_shmem_walk_ops to call shmem_partial_swap_usage() for each
> PTE hole.
>
> The new code removes all of this. The pt_range_walk API does not
> have pte_hole callbacks, so shmem pages that are swapped out (and
> thus have no PTE) would not be counted in the Swap field of smaps?

Yes, sorry, that is one of those parts which is incomplete.
I am already working on that offline, but did not have the time to
prepare it for this one.

--
Oscar Salvador
SUSE Labs