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 017F4C072A2 for ; Wed, 22 Nov 2023 03:46:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0F0D66B054E; Tue, 21 Nov 2023 22:46:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 07AD46B054F; Tue, 21 Nov 2023 22:46:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EA9926B0550; Tue, 21 Nov 2023 22:46:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D6EFA6B054E for ; Tue, 21 Nov 2023 22:46:00 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9F8C514038D for ; Wed, 22 Nov 2023 03:46:00 +0000 (UTC) X-FDA: 81484201680.08.C2ACE94 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf28.hostedemail.com (Postfix) with ESMTP id B16E0C0011 for ; Wed, 22 Nov 2023 03:45:58 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=msLXtplR; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1700624758; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+ZdQxYStF7qlczejYvvnc/fNWLDpo7+8IzuOh8Ic98s=; b=PoQIwj3298GGiHn7P81HCqNZDvoVX6QmCiRIJ6s7xHdz0dwEM7KMDde7QlSQl7zFk/0vm6 A3Yjc6fF/EpgJ5pGQRU92gU5IiO5jnlPCWOum3bXTmamHFtGKzd4nMc3VkAJppifn1a+Yo Bl1SLDkFmm8l6l5WRZ9eaAvkFj6zlIQ= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=msLXtplR; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf28.hostedemail.com: domain of chrisl@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=chrisl@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1700624758; a=rsa-sha256; cv=none; b=DKpfkidEccHGxJXrh2jbKtiIuS6X29VYSdx6+r8ZVjOvBCqavVZdd4bRCZZrQ1iKi7+sSb 1M9vK3u4fImJXpytSk1pEU1GBUCU9YqjHeyd7X4n3qyAe/dRv19hEkEVgpgpbVLoCrkYG6 HM6mAiIUZmbsx47dXaInZz7yX/B/G40= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 9E61261C1D for ; Wed, 22 Nov 2023 03:45:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4448C433B8 for ; Wed, 22 Nov 2023 03:45:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700624756; bh=+ZdQxYStF7qlczejYvvnc/fNWLDpo7+8IzuOh8Ic98s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=msLXtplR8mSlOEfzmyxfTkfELcgoG6wuvyPcU4rOokfs8nkmmXgZ16VyHEu85Ee+x qqiL9VF3YRExnkBYk5tkn39V5qD47ofmZtHTDvl7OmtUYUIWEpKeGjgP/gPgA9tgcJ AC/WB2WZtEfqswJgRKxveM81T6RUOKyZP0RQxVPFy3JkxKuzZGaw85O9E5vREBIc/q QrSHjokB2c6plFbg+QPr3dbAPINYan4AuBeW6zI6bOaVifUswM2Vo2i3AujU4S16YO aPwx0tbWnNvVyMkcLYTsICZKhgk34PEMTJXYtRcTjSk2xLLBwFVW7GAO7lqsolr4ml LlhqvprpFr0Sg== Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-5bcfc508d14so4914852a12.3 for ; Tue, 21 Nov 2023 19:45:56 -0800 (PST) X-Gm-Message-State: AOJu0YwmnfvfWBy8eqYM1czWV8Yn8oIY3nNJYtpHppJxsTktCykc8ZTp AVOgTLVtBb+uVSZuEein9oX31BfXHtRMK2/LgXOkBg== X-Google-Smtp-Source: AGHT+IEcaHMwYV6MNu58EXGgqZl9LbbEuqb72Ci6XYjP9DfltYsYdqnYxHSvsyXaKBN7jDh17NKmVll4E2bTTyVX8Dw= X-Received: by 2002:a05:6a20:938b:b0:187:afb0:c2f5 with SMTP id x11-20020a056a20938b00b00187afb0c2f5mr1303175pzh.3.1700624756029; Tue, 21 Nov 2023 19:45:56 -0800 (PST) MIME-Version: 1.0 References: <20231115172344.4155593-1-nphamcs@gmail.com> In-Reply-To: From: Chris Li Date: Tue, 21 Nov 2023 19:45:44 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5] zswap: memcontrol: implement zswap writeback disabling To: Nhat Pham Cc: Yosry Ahmed , Andrew Morton , tj@kernel.org, lizefan.x@bytedance.com, Johannes Weiner , Domenico Cerasuolo , Seth Jennings , Dan Streetman , Vitaly Wool , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Hugh Dickins , corbet@lwn.net, Konrad Rzeszutek Wilk , senozhatsky@chromium.org, rppt@kernel.org, linux-mm , kernel-team@meta.com, LKML , linux-doc@vger.kernel.org, david@ixit.cz, Minchan Kim , Kairui Song , Zhongkun He Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: B16E0C0011 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: 9eep7cbht416uhkbgpb5wjkxgff8p6fr X-HE-Tag: 1700624758-878895 X-HE-Meta: U2FsdGVkX18fTjjQk5bmaeoi2BLrK7ltTXxDVpjHFWJqhwZiwxmjc9rt8JquN18fjIaBn+S5eI5RyKHkREYSyl+WQHlaohEHWckB4TBwkI0hW/neef9gHtbLsMquzQEJ+x1APKLY111Heo0m1l0nEItFU2U6BibQxDBHzLjhF8/qbcPs1ODcTJtXrqmck2Sss1m/aB3x37vKwT8Sr9ipZp3Q7HI6AhKk+9TadgDvzXxKgRKP6NX0rakCbsQfP1IHukbc66OT1tqXCTIHCTMK7WV7x9lnHho1Uujfp7mfb2VALib/BIk5oSR7H5MbjWjTxV6bN4Un+TLtldA3aREiDBKAKfvbQk6FQ4rVpBtqIg0F/fBIvNh+VfmS7pv5pbKRnhzbgDrt5DluXmswGy1CbWnML9WQN+zFeULa9yfKVRaUFgQdCxewcqpJvrmMjy+JvxXaFPLaYcLyzzfcUM5HkhERB0Pl2q/fbzQmXuMakKQW9N1BxjFttnDBZZHDtoJI/75uGMDcZ7H5FxfeeTBHp5QVs1GDIU37bynPpKNoQbowNrz99SCcSnHblFlERV8ul+syN9dw7yf1nDROwN8Vj/iL9x5o4bnelGKuOEs+rO6m4zxWBw9TYbhQO0jxv6+vbsEzb2VnSZiJN0LOEeS1Jq4NNeiASwtItyJmJTDdjmBByuQ7+cR+IPFp3yx+fP2eJS0Jl8qm4scdVx4ym/vXeo8p2D4RzubbxrQggTH9DdSn/rXTFkcpPKYT4YqhFJfcxdkRMG9Tvlgle6fMvcsAqQ8QDtIgaIl2LrttgvAmmm0fR/XkTSdVJZ6O8PndrzRkWjkKmxc1dp/c8CdPWq1jZBtsKuhGNMXzVeiJTSVolmSqSjTG28IDoXsArKXviwOTnuuJ2V75l3loYbb6oEMibo82LjbuojEZKrJlz3hJkdA/mpL9CvbM0nubZ44b4AyIbwYjeG/9nE0Mp7wYh3P wCyI3fKZ WIDZP216pNfYgFns6EpDhdSJ4bUxP36XrtWyiY47p7fARvNtojbLxeV51XV9rST8Ah/csJg1icEhto8Ux1/pABqFswbhfbcuT9YcLaeLQLlH6KbZYedpTvr7rm41k6yn0GoI0k79bqyb+biZD5iXlnM9sF9nZypRvT8AgXit37KibGTiUwJ4bp0ggyLNrrwcuREQzzdFcb87q793D5c0rM41gxg1sjWAS3ueFtzChMu5xvq1ZQkcfwcNnUDKvZBL18c65sXyfQYCtRTUYwInX1nKZvGsHDYXziDI0Uo6j2FSKg6k= 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: List-Subscribe: List-Unsubscribe: On Tue, Nov 21, 2023 at 5:19=E2=80=AFPM Nhat Pham wrote= : > > On Tue, Nov 21, 2023 at 11:09=E2=80=AFAM Chris Li wro= te: > > > > On Tue, Nov 21, 2023 at 10:13=E2=80=AFAM Nhat Pham = wrote: > > > > > > Hi Chris! > > > > > > Thanks for the patch. Would you mind if I spend some time staring > > > at the suggestion again and testing it some more? > > > > Of course, by all means. That is just the minimal version to be > > functional compatible with your zswap.writeback. > > > > I might consider a follow up patch to add "no_zswap" and "none" to > > convert the SSD only swapfile, which can't be expressed by > > zswap.writeback. > > That should cover all 4 combinations of zswap and swap files without > > creating a custom swap tiers list. > > > > "all": zswap + swapfile > > "zswap": zswap only > > "no_zswap": swapfile only. > > "none": no swap. > > > > All keyword names are open to suggestions. > > SGTM! There might be some functionality duplication between > memory.swap.tiers =3D no_zswap and memory.zswap.max =3D 0, but > otherwise this seems reasonable to me. Yes, there is some function duplication. However, there is some small difference that no_zswap will not enter zswap code at all. Vs memory.zswap.max will take a short trip into zswap code to find out Oops, not zswap for you. > > no_zswap sounds a bit awkward, but I can't come up with a better > name. Again, I am open to better suggestions. I have also considered "!zswap", "!" has special meaning in bash, so it will require quoting in bash. How about "-zswap"? This does not require special quoting in bash. > > > > > > > > > If everything is good, I'll squash this patch with the original versi= on, > > > (keeping you as a co-developer of the final patch of course), and > > > update the documentation before re-sending everything as v6. > > > > Great! > > > > > > > > Anyway, have a nice Thanksgiving break everyone! Thanks for > > > taking the time to review my patch and discuss the API with me! > > > > My pleasure to discuss the swap with you. We should do the online > > "swap meet" and invite other developers who are interested in the swap > > area as well. > > I look forward to this meeting! I'd love to discuss more about (z)swap > development (and more generally, multi-tier memory management). Let me arrange one then. I am thinking maybe every second week of the month. That can avoid thanksgiving, christmas and new year. Let me throw in some more ideas: writing compressed zswap data to SSD without swap cache. > Generic page promoter/demoter that takes into account workload > (cgroup), access recency (LRU + generations)/frequency, and tier > characteristics (latency, bandwidth, etc.) will be awesome to explore! Sounds great. Looking forward to it. Chris