Re: [PATCH v5 2/3] mm: swap: drop dropbehind swap cache folios on writeback completion
From: Barry Song
Date: Fri Sep 18 2026 - 19:29:15 EST
On Fri, Sep 11, 2026 at 8:16 PM Alexandre Ghiti <alex@xxxxxxxx> wrote:
>
> A PG_dropbehind folio is dropped from its cache once writeback completes
> rather than left for reclaim to find later; this is implemented for file
> folios in folio_end_dropbehind(). Extend it to swap cache folios.
>
> The drop takes the folio and swap cluster locks and may sleep, so it
> cannot run in interrupt context. Set BIO_COMPLETE_IN_TASK on the write,
> as the file dropbehind paths do, and drop the folio directly from
> folio_end_writeback().
>
> Suggested-by: Yosry Ahmed <yosry@xxxxxxxxxx>
> Suggested-by: Johannes Weiner <hannes@xxxxxxxxxxx>
> Suggested-by: Nhat Pham <nphamcs@xxxxxxxxx>
> Reviewed-by: Nhat Pham <nphamcs@xxxxxxxxx>
> Reviewed-by: Kunwu Chan <kunwu.chan@xxxxxxxxx>
> Signed-off-by: Alexandre Ghiti <alex@xxxxxxxx>
> ---
LGTM,
Reviewed-by: Barry Song <baohua@xxxxxxxxxx>