Skip to contentSkip to conversation

mm-swap-submit-the-last-readahead-batch-before-unplugging.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Oct 24

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/swap: submit the last readahead batch before unplugging
has been removed from the -mm tree. Its filename was
mm-swap-submit-the-last-readahead-batch-before-unplugging.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Alexandre Ghiti <[email protected]>
Subject: mm/swap: submit the last readahead batch before unplugging
Date: Thu, 1 Oct 2026 10:57:12 +0200

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.

Fixes dda8fb68b590 ("mm/swap: also use struct swap_iocb for block I/O")
Cc Chris Li <[email protected]>
Cc Kairui Song <[email protected]>
Cc Kemeng Shi <[email protected]>
Cc Nhat Pham <[email protected]>
Cc Baoquan He <[email protected]>
Cc Barry Song <[email protected]>
Cc Youngjun Park <[email protected]>

---

 mm/swap_state.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/swap_state.c renamed from mm/swap_state.c~mm-swap-submit-the-last-readahead-batch-before-unplugging +2 -2
@@ -906,8 +906,8 @@ struct folio *swap_cluster_readahead(swp
 			continue;
 		folio_put(folio);
 	}
-	blk_finish_plug(&plug);
 	swap_read_submit(&ctx);
+	blk_finish_plug(&plug);
 skip:
 	return swap_cache_read_folio_sync(entry, gfp_mask, mpol, ilx);
 }
@@ -1019,8 +1019,8 @@ static struct folio *swap_vma_readahead(
 	}
 	if (pte)
 		pte_unmap(pte);
-	blk_finish_plug(&plug);
 	swap_read_submit(&ctx);
+	blk_finish_plug(&plug);
 skip:
 	/* The folio was likely read above, so no need for plugging here */
 	return swap_cache_read_folio_sync(targ_entry, gfp_mask, mpol, targ_ilx);

_

Patches currently in -mm which might be from [email protected] are