Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1166964rdb; Wed, 6 Dec 2023 10:16:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUtu3hFd3WT36VJVnMMAp14NtwHswR8xxaCnv7vqnvwYw2oqLEXaujP/17CHMMGk++6aS1 X-Received: by 2002:a17:903:11c9:b0:1d0:81a3:443c with SMTP id q9-20020a17090311c900b001d081a3443cmr1035615plh.113.1701886575831; Wed, 06 Dec 2023 10:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701886575; cv=none; d=google.com; s=arc-20160816; b=y3Ehs6Ccc8jirqW32AY9AZCCOEw36Twl1JT2mjhij/9hrTQs57LJKXiDG0+sN9lcmy bWXghEagEvHNz2Qr55ytvnjxQ7CWZxuGLKfrDhMadqXQDzE8GU+Gk+95gTCZ4qqU0gbf hX1nitlmiSgJHM5dfpPp6peLO7Ya9FD3RpdQksTxBCkaXLbdKZ0q46aAhuEDMZsCz3Uh wtMsj7GtNPmtxABsvN0zdMgGZ1LvUsBj77wHSqJsxiXzxnkEGFmCWWtnG/3pkublQ2CY sKl/7jzF6km8V1usDfFQLOlA7s1alANkjbhoUi2uoDGeV3yN5CMHigf4cNE6QWgAnCtI pejA== 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=gWAuKbmc4GqDy2A6rXUBPXUJNeUa8820dSUeOYSYNt8=; fh=vrRJ6THxHbrSldogpHi9EZ1a7k4f6J3mb2v2jybUcL4=; b=TVRrBIQvC4xz8ZTjG8+Fh410xHTZ5NHu2EQkploWDKyBEpqUC2eZ/KkFabUBEiwuky GmOtXzZnJlJGHY9cGtOaeeX/hasyZKEfNZgvKzVXwBWWOPooYrtUGUWl1yeUqdzoIi3H 6bYHfr9UrHFfiYEKhOO0JfVZ9hPiTunRAMuj/oORoxDGC5iPoUJrzlaLkoJX1yof0jLK CsBHIGIT37gNA+byT2GHnQxMTs4ZunG4dUDeCdv9ju/5v809uM3908GRUHRMSwhdmr+8 7i5tQBghtLU47SAKsp5RmJUmj6PjgQbWHamx6VryuaABKbxgw/WfLbYiyEldWPdKUaWv /UpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lBPJbL2S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w17-20020a1709027b9100b001d0087bbf19si158877pll.440.2023.12.06.10.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 10:16:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=lBPJbL2S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A54388026ADD; Wed, 6 Dec 2023 10:16:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229682AbjLFSQE (ORCPT + 99 others); Wed, 6 Dec 2023 13:16:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229457AbjLFSQC (ORCPT ); Wed, 6 Dec 2023 13:16:02 -0500 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03469139; Wed, 6 Dec 2023 10:16:08 -0800 (PST) Received: by mail-io1-xd2f.google.com with SMTP id ca18e2360f4ac-7b389399dfdso2252039f.2; Wed, 06 Dec 2023 10:16:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701886567; x=1702491367; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=gWAuKbmc4GqDy2A6rXUBPXUJNeUa8820dSUeOYSYNt8=; b=lBPJbL2S1TEBPSIZbkawYgKsUuydV4LjcC2j78T85S803TF93P2AhlfIOfksbkMi0P y+LFIkLdNK8OaZQ6deOU6TsHxyL57QTUUO8RKncz+oJw8RxHbc3y6OV9jKoTT8UfvspE i7jjiqIuprT33JoWvs8YHASLUfWKKBrSu7SAOaVW1PonOf7wLNlEYpjmiufXkkzmlmKG aF2ktP4Tv1dfZdjmavrRWR+UzWwzYKSR0I1IlsdVR/SBKNotbQSAEd09fQdYPvpiVAgZ 5Ctn9RlC09pO8NrCE3CHIo3a7v/uZtDG5en6wcrakatNAhvNj9H6KNVQTPmYTGS/4Eqy X+Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701886567; x=1702491367; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gWAuKbmc4GqDy2A6rXUBPXUJNeUa8820dSUeOYSYNt8=; b=RpS+Ebm8ZzG6Nsl3c7mCXsFv5IjJ56/xkSHn62W8LAjEKiuMNVthAtdijxGzItGIeX LMmXaIfugjDCvKWUPaqt9ttwRGGyXCQQq1tGkcTTMoQlAapiXHIR2s6C+AyT24tiOVkc brtD/2f6t1T7RT6BLciV8tDQAc1UpvUl4CZpYR+jGc3o5ERHyw3uSQvyrFmF7AYQVMxd AxuY86nE566BP5LhUYxlfrmcX+ALnfH1kygnHvxUQsL2G8oXMFQri13HthdQg/NPoJHz jz4EwN/PvgfD1KbyAuah9dcVlPSljaEG4JAULQ5PWAFeMODU2WnerHwR3FtW8kEDs13F tG0g== X-Gm-Message-State: AOJu0YywWWSUibvKHwV6EyZSpNQ8SQFBLsEAQbmpYcHsLwkVmr6NiOxC TT+YFh7Pk8Ry1KhZyN+uSW9URqoZxou1cC9T8SpP/8SxBSA= X-Received: by 2002:a6b:ed19:0:b0:7af:fff7:c3f8 with SMTP id n25-20020a6bed19000000b007affff7c3f8mr1385949iog.15.1701886567239; Wed, 06 Dec 2023 10:16:07 -0800 (PST) MIME-Version: 1.0 References: <20231115172344.4155593-1-nphamcs@gmail.com> In-Reply-To: From: Nhat Pham Date: Wed, 6 Dec 2023 10:15:56 -0800 Message-ID: Subject: Re: [PATCH v5] zswap: memcontrol: implement zswap writeback disabling To: Chris Li 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Wed, 06 Dec 2023 10:16:14 -0800 (PST) On Wed, Nov 22, 2023 at 7:01=E2=80=AFAM Chris Li wrote: > > On Tue, Nov 21, 2023 at 5:19=E2=80=AFPM Nhat Pham wro= te: > > > > "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. > > > > no_zswap sounds a bit awkward, but I can't come up with a better > > name. > > I sleep on it a bit. I should apply my own suggestion of using the > positive words rather than negative one to myself. > I actually define it as a non RAM base swap device. How about "disk"? > It will include SSD and HDD disk. > > The current 4 combination will be: > > "all": zswap + disk swap file > "zswap": zswap only > "disk": disk only (including SSD and HDD) > "none": no swap for you. > > Chris Hi Chris, I chatted with Johannes a bit more about this design. While we still think it's potentially useful for the future, it lacks a concrete use case at the moment. We don't even have the infrastructure for multiple swap tiers at the moment, so adding this interface now is just making it more confusing for the users. I think zswap.writeback is a much more specific interface, with concrete and immediate usability (it stems from internal chatters and requests - so the demand is already there). I think we should just land the change we currently have (rebased on top of mm-unstable to resolve merge conflicts etc.). I don't think zswap.writeback will get in the way of any swap.tiers functionality, correct? There might be some functionality duplication, but that's not too bad IHMO. Then we can work on swap.tiers design and implementation as we add the support for multiple swap tiers.