Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp838716rdf; Tue, 21 Nov 2023 19:47:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbYg7WiT7ua+GwVCiqExwWzDOnkMs6pijkbl/egl2o0X8WhkFowAsuqL/PCoVbM0ybbhgn X-Received: by 2002:a05:6870:bb19:b0:1f9:4244:4c52 with SMTP id nw25-20020a056870bb1900b001f942444c52mr1618955oab.41.1700624849319; Tue, 21 Nov 2023 19:47:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700624849; cv=none; d=google.com; s=arc-20160816; b=RwkkNZ/osC62aQ1WI0X/aVZoyPXjzIlEwj/OpF3npUnQkbsdgNCqhP7dzz6RcDc6g6 JnGZta5TfbCslZOxTlLCeFxYhq2/6+bnCZ9PgVm0Hc9zZYcJU8HdgDoNC3cpAi3gBZAl 9PMSWE3uLc5sE2g0TnVqAxVtpojHY/ChR4dn8plIiysXK8p3/XgB5sgpQm6v4qpMLKE9 myOyAYtMkUf+TYFJxALzSGIVggTTCXMuoxKiu38Y+lDXUi5bgDDjv0hiaColfG46Pn/t cCCyug4GquU0ZsguL6WneZiB/YyHnngPBMwC9Ijj/drabhxuCJVUAYoVAvm3JBDM4qAF 5rgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+ZdQxYStF7qlczejYvvnc/fNWLDpo7+8IzuOh8Ic98s=; fh=L983Jft7l6PMve0D1cxmqJuY+PwvHUgVl9dlWgZCd10=; b=JOFAQFRnjqk+VAGMZb68PW7GLf6pZ4s6vHT4fm4lp/nzXF9oPpEyQma7+M1U5GeXZ4 xEjM6vit564qfCL8tFUCHaQcfdJ1C7zXvRFC0RDLxxaYED+OqoaOPUGbkzCTyGP3rrn5 rgZKJ2R6WTAfrIeVoPb4y7mS2ciF3enmtHNVR7sNvWcF4jz3qcjq9LujY6l/66eNzs5M +8dREDj/xLrjWHx8XT8nFXb5CntHqxVA5Z8M0H+HfiR2jcqWpPNVGivdY7NeF+b4rJZq 7xgKw+xgE0tR5ennfQovxp/aELyGXt+V+WcsW22MIiwqJ3cf6MevEuS62bl1y81wM0S8 KA5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MJ/kWN8F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id e12-20020a631e0c000000b0057c2f61474asi11164727pge.290.2023.11.21.19.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 19:47:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MJ/kWN8F"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 02D75809EC80; Tue, 21 Nov 2023 19:46:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343574AbjKVDqW (ORCPT + 99 others); Tue, 21 Nov 2023 22:46:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235035AbjKVDqV (ORCPT ); Tue, 21 Nov 2023 22:46:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34BBE18E for ; Tue, 21 Nov 2023 19:46:18 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8DF4C433CB for ; Wed, 22 Nov 2023 03:46:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700624777; bh=+ZdQxYStF7qlczejYvvnc/fNWLDpo7+8IzuOh8Ic98s=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=MJ/kWN8FiAdyH/TlhkMFfVxKmsQt5ZJSZsz1SQe6GM85jolnlWz3KkrpdXUgc3Iem 6a/zk8D4dCdoLCa/UMpSZq6sEE16gnPqH1rYBxeVg7rhg9QNqEECfM2jlPPMcTIQCE F9yipKBXj01XiCaWxern0w/6NweCUtBALYQMxKIg5RGtSPPaUNkRJvpGZ4f24WLVVo m5oMm5CaE2hAAaax9bGY5s1cXCBiXrqkblchs828d2q6t23PYoVWfo8zjY0qltdhl8 oqfOh0LVjP2HsqKQZGmOSLALAUWoNzW8+rE8moyUqHiyX3cirBmEjRgO7GHPbncjZh we57VjwsUNSeA== Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-778927f2dd3so317189485a.2 for ; Tue, 21 Nov 2023 19:46:17 -0800 (PST) X-Gm-Message-State: AOJu0YyKtkNyjL7zHbvnaHc1QlwPSsHs2XNXgZ17tsOb4I7sfsUkaBeX aZ2ht2k1DjX2491+lh+S7Ip450lGZKkCkRCr8sDZeQ== 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-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 21 Nov 2023 19:46:32 -0800 (PST) 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