From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.76 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796408505; b=Bywq/rNAadICF1ypsaeLQN4HZx5oSBZYIOlGDZbwSIt8fnTFd/HAEd/yDVX3h0rynREA MeqJfxuLJ/9bdpMEWpU4WffEn1Db2Lpdhv8ui5s6ttItmO8DSoty2xLVxnSUcSPiBVEAm DBS88TUKW4imip+/5WUTD8kG0UtTdjLZH2ccYHQkUscP349GA2O2GbSaMReOG64ot4jCo ETWR77UCGCH9+jGhz7nP3sVlctcTANpsD6qrmYJr676lz0ajxvbeM1TrbsI+e8lZU6THN K+8xg2pvyXAZvsxOpYl8LldbF0Lq7LCZ5xcGiS+sxG37fLmL20VjqOfAo9aePWmTS3w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796408505; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:From:To:Cc:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=g8jYYFCRM6Ap6dhh+pFipv2JvT6UwlH3rpd9oWi/PCw=; b=236kupl/ZfuQfB2s2sZSB0SZHimZwJmTtw7ivnZVsAmkBqXqXL/SJO8x9S4rpXjRXbie dTBRwwz0U2kImJN2N7fMsdBUx9xeb9oW81fR8r5N2pknKL0AS6eCIxsN2T8okt1Xp2plV 0NIEIRLMVZmB9OxrxUiUUEYeXonblAizGM7BhdNcHhsGJ/kWGK9uHZFULeF6d74ssBqar /Eqb6qQCVoSRjyoCkawzCTdrqyqNStD5x9gJWLQq3+bYsLAHl4YfzJzCAlxx+uzn+8owS 9ep6OgrwNu08RMZdVNwyLf0+mhIiEkqo9X7Cr7NNdikdQbyX7IJ6c4x+ZoI4uhbfYAw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=p+nbufP1; arc=none smtp.remote-ip=91.218.175.76 Received: from mta0.migadu.com (out-76.mta0.migadu.com [91.218.175.76]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E176D606A322 for ; Fri, 4 Dec 2026 18:21:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E176D606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=p+nbufP1 X-Envelope-To: mm-commits@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=uuWAE46WTm/gMMeF9QlFoUQw29sYJWckE3Pv5XnPJO8=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796408502; v=1; x=1797013302; b=p+nbufP1LqJUl8qGgc22M3XGXaXWK+bu32/4FwZ2CwlS7SEls2LSN1phSDF4lbPdwZuR3KlT OyfC+0mLV7imsUVTEU8RMB0e6W7HyZK/LOU4sTKHqiiUZSdyM++dwGnpO78RHn1vWV38kVItena cC7VB0BoITctMEUA/Q0M1enc= X-Envelope-To: mm-commits@vger.kernel.org Received: by mta12.migadu.com with ESMTPS id 7b69c880733444e6; Fri, 04 Dec 2026 18:21:42 +0000 X-Mizu-Trace-ID: 7b69c880733444e6 X-Migadu-Flow: FLOW_OUT From: Usama Arif To: Andrew Morton Cc: Usama Arif , 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 Subject: Re: [-] mm-shmem-bypass-swap-readahead-for-zswap.patch removed from -mm tree Date: Fri, 4 Dec 2026 10:21:37 -0800 Message-ID: <20261204182138.2156108-1-usama.arif@linux.dev> X-Mailer: git-send-email 2.53.1 In-Reply-To: <20261204175452.8E2561F00A1D@smtp.kernel.org> References: X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 04 Dec 2026 09:54:51 -0800 Andrew Morton wrote: > > 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 Sorry for all the confusion but the patch would go through you [1] in the tree where the commit "mm: bypass swap readahead for zswap" exists. [1] https://lore.kernel.org/all/c83e5dbd-9649-4133-8d7d-0092928d0572@kernel.org/ > > ------------------------------------------------------ > 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 > >