Re: [RESEND v7 13/29] mm: zswap: reject high-order swap cache allocations backed by zswap
From: David Hildenbrand (Arm)
Date: Thu Sep 24 2026 - 16:32:47 EST
On 9/14/26 14:28, Usama Arif wrote:
> zswap stores swapped-out pages one at a time, so a range of swap slots can
> be split between zswap entries and the backing device. A high-order
> swap-cache folio over such a range cannot be read back in one go: the disk
> read would return stale or zero data for every slot zswap owns.
>
> Reject that in __swap_cache_alloc(). Do the check after the folio is in the
> swap cache: from that point zswap can neither start storing nor start
> writing back any slot in the range, so the answer is stable. Callers
> already fall back to order-0, which zswap_load() handles per page.
>
> Export zswap_is_present() for the PMD-order swap-in users added later.
>
> Co-developed-by: Alexandre Ghiti <alex@xxxxxxxx>
> Signed-off-by: Alexandre Ghiti <alex@xxxxxxxx>
> Signed-off-by: Usama Arif <usama.arif@xxxxxxxxx>
> ---
For 10:30pm that is way over my head to review. I'll rest assured that zswap
folks have that under control.
--
Cheers,
David