Re: [PATCH v3 2/4] mm: drop stale folio_ref_count()==1 check in do_swap_page reuse logic
From: David Hildenbrand (Arm)
Date: Thu Jul 02 2026 - 04:08:22 EST
On 7/2/26 01:59, Barry Song (Xiaomi) wrote:
> The "we just allocated them without exposing them to the swapcache"
> case no longer exists, as Kairui has routed synchronous I/O through
> the swapcache as well in his series "unify swapin use swap cache and
> cleanup flags"[1]. As a result, folio_ref_count() should never be 1
> in this path, since at least two references are held (base ref plus
> swapcache). Remove the folio_ref_count()==1 check and update the
> comment accordingly.
>
> [1] https://lore.kernel.org/all/20251220-swap-table-p2-v5-0-8862a265a033@xxxxxxxxxxx/
>
> Acked-by: Usama Arif <usama.arif@xxxxxxxxx>
> Reviewed-by: Kairui Song <kasong@xxxxxxxxxxx>
> Reviewed-by: Baoquan He <baoquan.he@xxxxxxxxx>
> Acked-by: Shakeel Butt <shakeel.butt@xxxxxxxxx>
> Signed-off-by: Barry Song (Xiaomi) <baohua@xxxxxxxxxx>
> ---
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David