Re: [PATCH hotfix] mm: shmem: fix ShmemHugePages at swapout

From: Shakeel Butt
Date: Thu Dec 05 2024 - 12:00:33 EST


On Wed, Dec 04, 2024 at 10:50:06PM -0800, Hugh Dickins wrote:
> /proc/meminfo ShmemHugePages has been showing overlarge amounts (more
> than Shmem) after swapping out THPs: we forgot to update NR_SHMEM_THPS.
>
> Add shmem_update_stats(), to avoid repetition, and risk of making that
> mistake again: the call from shmem_delete_from_page_cache() is the bugfix;
> the call from shmem_replace_folio() is reassuring, but not really a bugfix
> (replace corrects misplaced swapin readahead, but huge swapin readahead
> would be a mistake).
>
> Fixes: 809bc86517cc ("mm: shmem: support large folio swap out")
> Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx

Reviewed-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>