Re: [PATCH] mm/zswap: convert zswap_store_page() and zswap_compress() to take a folio
From: Tal Zussman
Date: Sat Sep 05 2026 - 21:16:55 EST
> Currently, zswap_store() iterates through a folio and extracts individual
> struct page pointers using folio_page() to pass into zswap_store_page()
> and zswap_compress().
>
> Pass the folio and the page index directly into these functions instead.
> This eliminates the need to materialize struct page pointers inside the
> zswap_store() loop and replaces legacy page-based accessors with their
> folio equivalents:
>
> - sg_set_page() -> sg_set_folio()
> - kmap_local_page() -> kmap_local_folio()
> - page_to_nid() -> folio_nid()
> - page_swap_entry() -> calculated via folio->swap and index
>
> Signed-off-by: Wilson Felipe Pereira <wfelipe@xxxxxxxxxx>
>
I have a very similar patch as part of a larger series here [1].
It looks like we mostly aligned apart from a helper the series
introduces, so I can easily rebase on top of this if this is applied,
so:
Reviewed-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
[1]: https://lore.kernel.org/linux-mm/20260830-folio_swap_entry-v1-4-7786b52acbc8@xxxxxxxxxxxx/
--
Tal Zussman <tz2294@xxxxxxxxxxxx>