From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,youngjun.park@lge.com,yosry@kernel.org,
shikemeng@huaweicloud.com,shakeel.butt@linux.dev,rkeilty@meta.com,
riel@surriel.com,nphamcs@gmail.com,kasong@tencent.com,hughd@google.com,
hannes@cmpxchg.org,dgreid@meta.com,david@kernel.org,chrisl@kernel.org,
chengming.zhou@linux.dev,baoquan.he@linux.dev,baolin.wang@linux.alibaba.com,
baohua@kernel.org,atish.patra@linux.dev,alex@ghiti.fr,usama.arif@linux.dev,
akpm@linux-foundation.org
Subject: [-] mm-shmem-bypass-swap-readahead-for-zswap.patch removed from -mm tree
Date: Fri, 04 Dec 2026 09:54:51 -0800 [thread overview]
Message-ID: <20261204175452.8E2561F00A1D@smtp.kernel.org> (raw)
In-Reply-To: <20261203180253.2129141-1-usama.arif@linux.dev>
The quilt patch titled
Subject: mm/shmem: bypass swap readahead for zswap
has been removed from the -mm tree. Its filename was
mm-shmem-bypass-swap-readahead-for-zswap.patch
This patch was dropped because David is taking it
------------------------------------------------------
From: Usama Arif <usama.arif@linux.dev>
Subject: mm/shmem: bypass swap readahead for zswap
Date: Thu, 3 Dec 2026 10:02:53 -0800
Commit 7ed825f0f766 ("mm: bypass swap readahead for zswap") made
do_swap_page() skip readahead for zswap entries, but shmem_swapin_folio()
still only skips it for SWP_SYNCHRONOUS_IO devices.
zswap decompresses in the faulting task, so readahead has no I/O to
overlap and only slows the fault down. And since zswap loads are
exclusive, pages read ahead but never used stay uncompressed in memory
until reclaim compresses them again.
Use swap_entry_synchronous() in shmem_swapin_folio(), like do_swap_page().
zswap entries then take the SWP_SYNCHRONOUS_IO path, which already uses
order-0 folios once zswap has been enabled. Entries on the backing device
keep cluster readahead.
On productions hosts that run VM workloads backed by shmem guest memory
with memfds and swaps only to zswap, about a third of shmem readahead
pages were never used. In a QEMU guest with a 2 GB memfd in zswap and
page-cluster=3, faulting in 10% of it left 36 MiB in the swap cache before
this change and none after. The memcg grew 24 MiB less and the faults
took 12% less time.
Link: https://patch.msgid.link/20261203180253.2129141-1-usama.arif@linux.dev
Signed-off-by: Usama Arif <usama.arif@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Yosry Ahmed <yosry@kernel.org>
Reviewed-by: Nhat Pham <nphamcs@gmail.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Chengming Zhou <chengming.zhou@linux.dev>
Cc: Christopher Li <chrisl@kernel.org>
Cc: Kairui Song <kasong@tencent.com>
Cc: Kemeng Shi <shikemeng@huaweicloud.com>
Cc: Baoquan He <baoquan.he@linux.dev>
Cc: Youngjun Park <youngjun.park@lge.com>
Cc: Alexandre Ghiti <alex@ghiti.fr>
Cc: Rik van Riel <riel@surriel.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: <rkeilty@meta.com>
Cc: <atish.patra@linux.dev>
Cc: <dgreid@meta.com>
mm/shmem.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/mm/shmem.c~mm-shmem-bypass-swap-readahead-for-zswap
+++ a/mm/shmem.c
@@ -2570,8 +2570,8 @@ static int shmem_swapin_folio(struct ino
/* Look it up and read it in.. */
folio = swap_cache_get_folio(swap);
if (!folio) {
- if (data_race(si->flags & SWP_SYNCHRONOUS_IO)) {
- /* Direct swapin skipping swap cache & readahead */
+ if (swap_entry_synchronous(si, swap)) {
+ /* Skip readahead: synchronous device or zswap */
folio = shmem_swap_alloc_folio(inode, vmf, index,
swap, order, gfp);
} else {
_
Patches currently in -mm which might be from usama.arif@linux.dev are
mm-zswap-use-separate-compression-and-decompression-requests.patch
mm-zswap-use-stack-requests-for-synchronous-decompression.patch
fs-proc-task_mmu-read-the-pmd-once-in-smaps_pmd_entry.patch
fs-proc-task_mmu-dont-read-young-dirty-from-a-non-present-pmd-in-smaps.patch
fs-proc-task_mmu-account-device-private-pmds-as-present-in-smaps.patch
next prev parent reply other threads:[~2026-12-04 17:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 18:02 [PATCH] mm/shmem: bypass swap readahead for zswap Usama Arif
2026-12-03 19:49 ` Yosry Ahmed
2026-12-03 19:53 ` Nhat Pham
2026-12-03 19:57 ` Shakeel Butt
2026-12-03 20:03 ` Andrew Morton
2026-12-03 20:07 ` Usama Arif
2026-12-04 3:21 ` Barry Song
2026-12-04 10:52 ` David Hildenbrand (Arm)
2026-12-03 20:03 ` + mm-bypass-swap-readahead-for-zswap-fix.patch added to mm-unstable branch Andrew Morton
2026-12-03 20:14 ` + mm-shmem-bypass-swap-readahead-for-zswap.patch " Andrew Morton
2026-12-04 1:24 ` [PATCH] mm/shmem: bypass swap readahead for zswap SJ Park
2026-12-04 6:39 ` Baolin Wang
2026-12-04 7:46 ` Chris Down
2026-12-04 10:53 ` David Hildenbrand
2026-12-04 12:24 ` Harry Yoo
2026-12-04 15:14 ` Lorenzo Stoakes (ARM)
2026-12-04 15:32 ` Usama Arif
2026-12-04 16:03 ` Yosry Ahmed
2026-12-04 17:23 ` David Hildenbrand (Arm)
2026-12-04 17:28 ` Yosry Ahmed
2026-12-04 18:26 ` Andrew Morton
2026-12-05 17:19 ` David Hildenbrand (Arm)
2026-12-05 0:46 ` SJ Park
2026-12-05 0:47 ` SJ Park
2026-12-04 17:54 ` Andrew Morton [this message]
2026-12-04 18:21 ` [-] mm-shmem-bypass-swap-readahead-for-zswap.patch removed from -mm tree Usama Arif
2026-12-04 18:03 ` [PATCH] mm/shmem: bypass swap readahead for zswap sashiko-bot
2026-12-04 18:36 ` Andrew Morton
2026-12-04 18:23 ` + mm-shmem-bypass-swap-readahead-for-zswap.patch added to mm-unstable branch Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261204175452.8E2561F00A1D@smtp.kernel.org \
--to=akpm@linux-foundation.org \
--cc=alex@ghiti.fr \
--cc=atish.patra@linux.dev \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=baoquan.he@linux.dev \
--cc=chengming.zhou@linux.dev \
--cc=chrisl@kernel.org \
--cc=david@kernel.org \
--cc=dgreid@meta.com \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kasong@tencent.com \
--cc=mm-commits@vger.kernel.org \
--cc=nphamcs@gmail.com \
--cc=riel@surriel.com \
--cc=rkeilty@meta.com \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=usama.arif@linux.dev \
--cc=yosry@kernel.org \
--cc=youngjun.park@lge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.