Skip to contentSkip to conversation

mm-swap-revert-to-single-folio-writes-for-synchronous-swap-devices.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Aug 25

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/swap: revert to single-folio writes for synchronous swap devices
has been removed from the -mm tree. Its filename was
mm-swap-revert-to-single-folio-writes-for-synchronous-swap-devices.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: Christoph Hellwig <[email protected]>
Subject: mm/swap: revert to single-folio writes for synchronous swap devices
Date: Thu, 23 Jul 2026 07:46:04 +0200

Patch series "swap_ops updates", v2.

This series is a follow on to the swap ops series now in mm-unstable.

The first patch reintroduces direct folio writes for synchronous swap files, the other two remove the double indirect for file system based swap.

This patch (of 3):

Kairui Song reported that zram benefits from submitting each folio directly instead of batching up I/O because the classic LRU scanning benefits from clearing the folio writeback bit in the scan loop.

Accommodate that by kicking off writes for synchronous devices for each iteration.

---

 mm/page_io.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
mm/page_io.c renamed from mm/page_io.c~mm-swap-revert-to-single-folio-writes-for-synchronous-swap-devices +10 -1
@@ -358,7 +358,16 @@ static void swap_add_folio(struct swap_i
 	}
 	bvec_set_folio(&sio->bvecs[sio->nr_bvecs], folio, folio_size(folio), 0);
 	sio->len += folio_size(folio);
-	if (++sio->nr_bvecs == ARRAY_SIZE(sio->bvecs)) {
+
+	/*
+	 * Write out the iocb if we filled it, or if the device is synchronous.
+	 *
+	 * The latter is to work around expectations in the classic LRU code
+	 * which make synchronous clearing of the folio writeback flag in the
+	 * reclaim path beneficial.
+	 */
+	if (++sio->nr_bvecs == ARRAY_SIZE(sio->bvecs) ||
+	    (rw == WRITE && (sis->flags & SWP_SYNCHRONOUS_IO))) {
 		if (rw == WRITE)
 			swap_write_submit(ctx);
 		else

_

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