Re: [PATCH] mm/swap: submit the last readahead batch before unplugging

From: Andrew Morton

Date: Thu Oct 01 2026 - 21:16:35 EST


On Thu, 1 Oct 2026 02:52:33 -0700 Joshua Hahn <joshua.hahnjy@xxxxxxxxx> wrote:

> On Thu, 1 Oct 2026 10:57:12 +0200 Alexandre Ghiti <alex@xxxxxxxx> wrote:
>
> > Since block swap I/O is batched in struct swap_iocb, swap_add_folio()
> > only appends a folio to the pending batch when its slot directly follows
> > the previous one, and submits the pending batch otherwise. Batches
> > submitted inside the readahead loop go through the plug, where the block
> > layer can still merge them, but the final batch is submitted after
> > blk_finish_plug() and always becomes a separate request.
> >
> > So submit the final batch before finishing the plug.
>
> Hi Alex,
>
> I read through the code and this looks very reasonable to me.
>
> Reviewed-by: Joshua Hahn <joshua.hahnjy@xxxxxxxxx>

Thanks.

> > Fixes: dda8fb68b590 ("mm/swap: also use struct swap_iocb for block I/O")
>
> My only question is whether we need the fixes tag, it seems like
> dda8fb68b590 is still in mm-stable and not merged to linus yet.
>
> Andrew, what do we usually do in these cases? I am wondering if it will
> just become folded into the original commit or if this should still be
> standalone.

dda8fb68b590 was added to 7.3.rc1 during the most recent merge window.

So the Fixes: is appropriate - if someone chooses to merge dda8fb68b590
into their downstream kernel we're telling them "hey, you need this one
as well".