From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD4B0125A9 for ; Wed, 26 Nov 2025 21:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764194389; cv=none; b=OqSIRbnY2HN175wH4cjroyN1mrrwclIOpCNhezUPj6vAwhpJve2RbjqAox6/tvdVlJl7UIpnhthm7yZZqkt27b0AREs07U6ZCdYppsYSnqACjTRSdXkz+2v4ezmAQ3+B/ZUhflaX2ZT91upWHmuLrBydBfRmSVuZrsHuHurdpkA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764194389; c=relaxed/simple; bh=9FkhvCudArfrRpOQTQrvflMO5v8bBNDfSZLO51b6y/4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=DG/vtkdAvYl9YzLv/9UKW5xRQDgBrHoMwsyDrxW2fIk7s/OgdgtzmmJCDW6AkCEoZ1QfyMvirFLqaHIdDY3njuIAsTNRgqbtCORB+Q286qYZJzrikWFfNPgKn8cru9G9LkuTFXnQ4fQx04NBZ0soJMgflmCc4UL2Ukh68AJ2VTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=surriel.com; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b=X+sJ48Zd; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=surriel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=surriel.com header.i=@surriel.com header.b="X+sJ48Zd" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=surriel.com ; s=mail; h=MIME-Version:Content-Transfer-Encoding:Content-Type:References: In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=9FkhvCudArfrRpOQTQrvflMO5v8bBNDfSZLO51b6y/4=; b=X+sJ48ZdNlCAogjTztyAKRLy1R U6d3zWP1hhP+nH0fjM+6qWJzElDwkNFcq7JjNku8WJKhsp5199ORO2EgqWHvVsjwmRxWtBvpoCT/9 dMZ2I1QkPDsq6nbXm5rC1Q/SgpEDrs6IlEXuHAkxTW8+oDZ0mJpYwnB+BLaLLM0/SltB4Iu1hE/JH gIYgbl2JuQHsaoFegLZ10eIm6INB4DqgKOvWW0gjnfNmVH9gzF/a35//lS+UjTanJuIYGbmyVdOgr dsMnqcCLtGCov64WmFRCv1+EvAn9MsSANjSj51GhrDXJrZqQdbLLqaIIrBJ5vSHEW6OFdx/oKgzVl vB31dKQQ==; Received: from fangorn.home.surriel.com ([10.0.13.7]) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1vONXL-000000000Ge-03qW; Wed, 26 Nov 2025 16:58:56 -0500 Message-ID: <3e90ccb0a3fd20e9b2d6e2cf19db9590394f7edc.camel@surriel.com> Subject: Re: [PATCH RFC] mm: ghost swapfile support for zswap From: Rik van Riel To: Chris Li , Yosry Ahmed Cc: Johannes Weiner , Andrew Morton , Kairui Song , Kemeng Shi , Nhat Pham , Baoquan He , Barry Song , Chengming Zhou , linux-mm@kvack.org, linux-kernel@vger.kernel.org, pratmal@google.com, sweettea@google.com, gthelen@google.com, weixugc@google.com Date: Wed, 26 Nov 2025 16:58:56 -0500 In-Reply-To: References: <20251121-ghost-v1-1-cfc0efcf3855@kernel.org> <20251121114011.GA71307@cmpxchg.org> <20251124172717.GA476776@cmpxchg.org> <2a8fd7bd35939b9aa4a7267c93e1fda995137966@linux.dev> Autocrypt: addr=riel@surriel.com; prefer-encrypt=mutual; keydata=mQENBFIt3aUBCADCK0LicyCYyMa0E1lodCDUBf6G+6C5UXKG1jEYwQu49cc/gUBTTk33A eo2hjn4JinVaPF3zfZprnKMEGGv4dHvEOCPWiNhlz5RtqH3SKJllq2dpeMS9RqbMvDA36rlJIIo47 Z/nl6IA8MDhSqyqdnTY8z7LnQHqq16jAqwo7Ll9qALXz4yG1ZdSCmo80VPetBZZPw7WMjo+1hByv/ lvdFnLfiQ52tayuuC1r9x2qZ/SYWd2M4p/f5CLmvG9UcnkbYFsKWz8bwOBWKg1PQcaYHLx06sHGdY dIDaeVvkIfMFwAprSo5EFU+aes2VB2ZjugOTbkkW2aPSWTRsBhPHhV6dABEBAAG0HlJpayB2YW4gU mllbCA8cmllbEByZWRoYXQuY29tPokBHwQwAQIACQUCW5LcVgIdIAAKCRDOed6ShMTeg05SB/986o gEgdq4byrtaBQKFg5LWfd8e+h+QzLOg/T8mSS3dJzFXe5JBOfvYg7Bj47xXi9I5sM+I9Lu9+1XVb/ r2rGJrU1DwA09TnmyFtK76bgMF0sBEh1ECILYNQTEIemzNFwOWLZZlEhZFRJsZyX+mtEp/WQIygHV WjwuP69VJw+fPQvLOGn4j8W9QXuvhha7u1QJ7mYx4dLGHrZlHdwDsqpvWsW+3rsIqs1BBe5/Itz9o 6y9gLNtQzwmSDioV8KhF85VmYInslhv5tUtMEppfdTLyX4SUKh8ftNIVmH9mXyRCZclSoa6IMd635 Jq1Pj2/Lp64tOzSvN5Y9zaiCc5FucXtB9SaWsgdmFuIFJpZWwgPHJpZWxAc3VycmllbC5jb20+iQE +BBMBAgAoBQJSLd2lAhsjBQkSzAMABgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRDOed6ShMTe g4PpB/0ZivKYFt0LaB22ssWUrBoeNWCP1NY/lkq2QbPhR3agLB7ZXI97PF2z/5QD9Fuy/FD/jddPx KRTvFCtHcEzTOcFjBmf52uqgt3U40H9GM++0IM0yHusd9EzlaWsbp09vsAV2DwdqS69x9RPbvE/Ne fO5subhocH76okcF/aQiQ+oj2j6LJZGBJBVigOHg+4zyzdDgKM+jp0bvDI51KQ4XfxV593OhvkS3z 3FPx0CE7l62WhWrieHyBblqvkTYgJ6dq4bsYpqxxGJOkQ47WpEUx6onH+rImWmPJbSYGhwBzTo0Mm G1Nb1qGPG+mTrSmJjDRxrwf1zjmYqQreWVSFEt26tBpSaWsgdmFuIFJpZWwgPHJpZWxAZmIuY29tP okBPgQTAQIAKAUCW5LbiAIbIwUJEswDAAYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQznneko TE3oOUEQgAsrGxjTC1bGtZyuvyQPcXclap11Ogib6rQywGYu6/Mnkbd6hbyY3wpdyQii/cas2S44N cQj8HkGv91JLVE24/Wt0gITPCH3rLVJJDGQxprHTVDs1t1RAbsbp0XTksZPCNWDGYIBo2aHDwErhI omYQ0Xluo1WBtH/UmHgirHvclsou1Ks9jyTxiPyUKRfae7GNOFiX99+ZlB27P3t8CjtSO831Ij0Ip QrfooZ21YVlUKw0Wy6Ll8EyefyrEYSh8KTm8dQj4O7xxvdg865TLeLpho5PwDRF+/mR3qi8CdGbkE c4pYZQO8UDXUN4S+pe0aTeTqlYw8rRHWF9TnvtpcNzZw== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-2.fc41) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Tue, 2025-11-25 at 22:50 +0400, Chris Li wrote: >=20 > > - We still cannot do swapoff efficiently as we need to walk the > > page > > =C2=A0 tables (and some swap tables) to find and swapin all entries in = a > > =C2=A0 swapfile. Not as important as other things, but worth mentioning= . >=20 > That need rmap for swap entries. It It is an independent issue. >=20 Wouldn't rmap for swap entries be more expensive than simply always having indirection for swap entries that are in use? With indirection, swapoff can just move pages from the being-swapoffed device into the swap cache, and if needed the memory can then be moved to another swap device, without ever needing to find the page tables. This sounds like an uncommon scenario, but it is functionally identical to what is done to pages during zswap writeback, where the page table entries stay unchanged, and the swap page is simply moved to another backend location. Why implement two things, when we can have one thing that does both, with no extra complexity over what zswap writeback needs? --=20 All Rights Reversed.