From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796406893; b=sn76ImMMsDKoXBhIyMPLYrUT4HF13sAJ+hweB4JmjVc+OzgVIRMfWiXG55sAyraCQqbD 5v09yLaINPZpfi0Q2/KxQwpOKJ3rx8xfMgiZCnYYdKWIJReJ9VkWAgXlsabh6ELnV4Cxt fsiNQgbi5GLTERL8cA2b/SDOwm0vO2G+HoLfddPlmVKkJbeG3AyueT1t0spkdD/sPSWwR z7Mzc1qxKzGMB6FVu1wEQOYXTPFr8ZdbaJmKq6FL3jIW9yeprgPRrG4GTBKZqxP2FWx8g ZlV+tLGBlzPCfX1fLCiTlb/XW07RTUceJiqG47VoR6zf/1vh5ySSiPZh+YOfrixw0+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796406893; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=BOEn4cfU7KJ4LK/7vpD9cscWrXcL37xgoYZKjrdoflE=; b=m2SlqnNVyl029MiEebBRCzNyhQ+dEsu8e5PfoDvkhNrWMlH2ygwm46TG20hyEYVZbLhV hpO8eTCQSzE3wwoOldCyNswGA3mjodtTu60ixGCLB/UYcc/z4de6rIFHDrgbpFEnIPDkH gReVoZnu++cdcZGhFS/QOZXU3K84IUA7ziNp4XBxIsHUDzniYAY36kf7axengNQL+Wz9D 3YKcKn0MAUVryAMdhkSlCPHC8ZzkNtBgDSKlfacBmDRD3xbL1Ij0urA94e81QIR/SEaZb HzxcvmliMaaXXeF1kydlt5pM0Jn60OqT/0ITFv+pTgoan1xieMjfjsbgZVgYoeKNNsQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=XoZVCwVn; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9302D606A322 for ; Fri, 4 Dec 2026 17:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=XoZVCwVn Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E2561F00A1D; Fri, 4 Dec 2026 17:54:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796406892; bh=BOEn4cfU7KJ4LK/7vpD9cscWrXcL37xgoYZKjrdoflE=; h=Date:To:From:In-Reply-To:References:Subject; b=XoZVCwVnq8Qql8j2Bbj2cWJ3V1648jNR4o63BMNisfdnQm6qQchIj1OoP2NlWwPTA YCH2HvmwtdH5oWzxHf3YkVJQVp8zMiMZAQ5pOwrR5hAxJpUi5g6G4gjvA01QJgPkLM 18FCRyWDFtV9j4/7q2usMsng5fBVKg9GoCi3urAc= Date: Fri, 04 Dec 2026 09:54:51 -0800 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 From: Andrew Morton In-Reply-To: <20261203180253.2129141-1-usama.arif@linux.dev> References: <20261203180253.2129141-1-usama.arif@linux.dev> Subject: [-] mm-shmem-bypass-swap-readahead-for-zswap.patch removed from -mm tree Message-Id: <20261204175452.8E2561F00A1D@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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 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 Signed-off-by: Andrew Morton Reviewed-by: Yosry Ahmed Reviewed-by: Nhat Pham Reviewed-by: Barry Song Reviewed-by: Baolin Wang Cc: Hugh Dickins Cc: David Hildenbrand Cc: Johannes Weiner Cc: Chengming Zhou Cc: Christopher Li Cc: Kairui Song Cc: Kemeng Shi Cc: Baoquan He Cc: Youngjun Park Cc: Alexandre Ghiti Cc: Rik van Riel Cc: Shakeel Butt Cc: Cc: Cc: 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