Re: [RFC PATCH v2 9/9] docs: mm: update THP swapin counter descriptions

From: Nhat Pham

Date: Fri May 29 2026 - 14:53:30 EST


On Fri, May 29, 2026 at 5:19 AM fujunjie <fujunjie1@xxxxxx> wrote:
>
> The THP swapin counter descriptions still describe large swapin as
> coming only from non-zswap swap devices. Update them now that
> zswap-backed large folio swapin can also increment swpin.
>
> Also describe policy and backend rejection as swpin_fallback cases,
> since speculative zswap large swapin can intentionally fall back before
> doing large IO.
>
> Signed-off-by: fujunjie <fujunjie1@xxxxxx>
> ---
> Documentation/admin-guide/mm/transhuge.rst | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst
> index 23f8d13c2629..59b7a0d09243 100644
> --- a/Documentation/admin-guide/mm/transhuge.rst
> +++ b/Documentation/admin-guide/mm/transhuge.rst
> @@ -667,13 +667,14 @@ zswpout
> piece without splitting.
>
> swpin
> - is incremented every time a huge page is swapped in from a non-zswap
> - swap device in one piece.
> + is incremented every time a huge page is swapped in from swap or
> + zswap in one piece.
>
> swpin_fallback
> - is incremented if swapin fails to allocate or charge a huge page
> - and instead falls back to using huge pages with lower orders or
> - small pages.
> + is incremented if swapin cannot use a huge page and instead falls
> + back to using huge pages with lower orders or small pages. This can
> + happen because allocation or charging fails, or because policy or
> + backend state rejects a speculative large swapin.

I think we should add separate zswpin and zswpin fallback counter for
THP rather than overloading swpin. We already do that for zswpout vs
swpout.