From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC640C74A5B for ; Thu, 23 Mar 2023 21:11:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31BBD6B0071; Thu, 23 Mar 2023 17:11:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CBEB6B0072; Thu, 23 Mar 2023 17:11:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 193586B0074; Thu, 23 Mar 2023 17:11:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0A7256B0071 for ; Thu, 23 Mar 2023 17:11:05 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id ACBB3160853 for ; Thu, 23 Mar 2023 21:11:04 +0000 (UTC) X-FDA: 80601408048.27.8604647 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf11.hostedemail.com (Postfix) with ESMTP id EDC4440004 for ; Thu, 23 Mar 2023 21:11:02 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=f64DlWb1; spf=pass (imf11.hostedemail.com: domain of chrisl@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1679605863; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ahABzjFawQNgypD8Sm1Sr/EQlWx6v8UHOXMIMlr3RE0=; b=X0VN7xWYal0gfOyqCjrcIghgxot4qU8/WLQz3yFm7S6GizHwwrOn2qSHfSdSCjfqJrby9y 0lW5SjuqdeShp3QdDaaqQOAE8uTQoN5fKZSAN74rrfr48vQz+ErfXERcVLAsPiffiSbtst KmHpD2LWl0n00w0ywiksyXnjfYOnvDU= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=f64DlWb1; spf=pass (imf11.hostedemail.com: domain of chrisl@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=chrisl@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679605863; a=rsa-sha256; cv=none; b=OL79z1F+Y0WqkRIKbsRf5xY7rvT/z6EWg/C+gE71MMJA6YuHvhTaJq7NDXrcRZdg2uNqcA wHrgTKmtn64U5xCwKjD1FnCjiyJ9upAfTDTD/4mUcAUbPTlWigPXSRXE5lWPDuXZI78XiT ZQq04EQUQKa7OXFdpqO1HTZ48Yo0VhY= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 842BBB82215; Thu, 23 Mar 2023 21:10:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90742C433EF; Thu, 23 Mar 2023 21:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679605858; bh=yPBoAtuDtHNvQAXsEJMs1CHudpB650rOlEUY9pWrVwk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f64DlWb16lbko/IpLZkBZuAXpt5YTpHVrUXssPkrXGBjGB8gY3vGXUKhVUBGYTHZl KensZAwyvo0k/OZ5m0HEwsPtl/1gkr/E+RPQs+q0kykQ4/G45eUp0TZHsELSYWyZDo hxt14qwM3CtG3KnOCi6YGKMt5RSd26qOJMHff9SO+7r4Rojvojh9ZEstlMwSafEhYe WHOxU1zZj8Tva8O6A9/x+KbCVuVfLoxJogCJUN1D6PlCcGCSfZTQTmGjtmr3gA7T7I v3gaS97AkBiggbEYA+tnsSU9q0DnpoG4xHbtZ9ZKl4ZBoiKcrpGfTJR/1+F7a3/Akg D+2R+mjWePXNg== Date: Thu, 23 Mar 2023 14:10:56 -0700 From: Chris Li To: Yosry Ahmed Cc: "Huang, Ying" , lsf-pc@lists.linux-foundation.org, Johannes Weiner , Linux-MM , Michal Hocko , Shakeel Butt , David Rientjes , Hugh Dickins , Seth Jennings , Dan Streetman , Vitaly Wool , Yang Shi , Peter Xu , Minchan Kim , Andrew Morton , Aneesh Kumar K V , Michal Hocko , Wei Xu Subject: Re: [LSF/MM/BPF TOPIC] Swap Abstraction / Native Zswap Message-ID: References: <87y1ns3zeg.fsf@yhuang6-desk2.ccr.corp.intel.com> <878rfothdg.fsf@yhuang6-desk2.ccr.corp.intel.com> <871qlgrm5j.fsf@yhuang6-desk2.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: prepwghm5zgjt815quxbmko7m6w16syu X-Rspamd-Queue-Id: EDC4440004 X-HE-Tag: 1679605862-267996 X-HE-Meta: U2FsdGVkX1+84ULcwvWAmT4RLD9uNZFb57FBeV4eJlW2aUer3MXEcdC0eAQ9c8jm/nrZFw8BM4YzOOI0A3ixsgGQxbDtSOdN5Xd1sknlrYtLA7iO7YKQSXixhJ0S1Kv94LydVUo5QfAs42mWkigL6TOMtswwSaMIIgzVDJ1jb1COinL3K4U/lIYfZ4McmT5pqQ79jRGhmfd9nDRrh1oxPVo11IFxhOJ+hXuAhx2yNiDm7SN4epwOWuFf0OqEmXuDBts1QpFzVv2LkVj4Ddq0gYDXb571Tc34G+7irELcPozhEAiiKjxr6GJPTXiTML/vwuORcv5gsUbmw0uFTkxyDZ4laMtQu8EQ2obvT0g6E6nVL/8igaBLpvOTxYK87o+UefV3mOJdDWpxy7fOVDgmP2oSsmnJnD2jHkZGaLi+VDQQ6txHn/vqyWteSuch0wLt6JzKQ6KwdeydL9YO7Q/7la/DIY6uTcY6TNo8xFFwztxTy7WwMa4I4rT1VMjznXL87c1ZjzrsBbzTM0N2CjekvLwFHt6JRCQH7Ds2oVWWBq/xBFrqwSEzskUYYpwAL052mKH3C92jJgEOsZ9Mk9U5Xp7rjoNDrlBsDTOx13aVkkrYDcQ1UMB/mgw3LsQUA5NWwmzJH9RdS7HpKkPekuWm+gMbOEfnbtX7AiIHRAJVow4e0O4duYOlLaWyOKAISuEZEfGir6uzZ/pkvWKlA1LY6J1GfBhhcuYdhE+swAFKH66SM9SD8Tg6NjBkesvS0UmtkMcsJMUTrBNr6E3hyPJk9SiQFjOvpkzQcqG4qLl1ccN6WzeaAtdmjSt+5stt5EyciuGAqYiGRTyaeM65CrjpTIILbTKeQBI1ElwM2XtHEQFTVVHAJ9teZM84uOmgtMtkMZJoGu4HWNNZ3zRQyOE7q3aCtlllGnIYEWdsJK4hv+lI6ODNn7/MCl94VVig+M3g6u3asaMqsmUxS2SP5zd eYM+wuTk ZNCf4w0Q4pMJIINNNK/jIJAoDFgLDHcjDbYmWF0n85EitTTUhEqpmdzl6QKINe3aswp9rWpFQ6zCIxpCIFYJg2RRaqNLVVVtkNXBCq1DpLPuMBMmXG5z/JOTlqUT/DZWdRyS7tm4kCIQmkORVLpmXF0P9l1E/eRczCiN6aKWj0YSdADP2vRs4HeXenPcnAlK5gI4m X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Mar 23, 2023 at 12:54:42PM -0700, Yosry Ahmed wrote: > > > > At the time of swap out page into A, we will not know if it will > > move to B in a later time. I guess the swap ID xarray look up always > > needs to be there? > > If the indirection is enabled, yes. Ack. > > > > > That means when B swap in a page, it will always look up the swap ID > > xarray first, then resolve to the actual swap_entry B1. > > Yes. There is an extra lookup. Ack. > > > There are some concerns with this design that I outlined in one of my > > > previous emails, such as having separate swap counting implementation > > > in different swap backends, which is a maintenance burden and > > > error-prone. > > > > I agree that allocating the swap ID and maintaining the free swap ID > > would be some extra complexity if we are not reusing the existing swap > > count code path. > > > > My other concern would be the swap ID xarray indirection is always there > > regardless if you need to use the indirection or not. > > I think the idea is that this design is more minimal than the proposed > swap_desc, so we can have it behind a config option and remove the > indirection layer if it is not configured. > However, I am not yet sure if this would be straightforward. I need to > give this more thought. Thanks for the clarification. I will give it some thought as well. Chris