Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5006229rdb; Tue, 12 Dec 2023 16:29:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkEO/GewZ0KSgOwVt+a4QMMvmmNruxhEQhhCV9ehE/yXLAOsE5p4NyccqsU1ich7mMzZtF X-Received: by 2002:a05:6a21:a5a0:b0:18c:19e2:5735 with SMTP id gd32-20020a056a21a5a000b0018c19e25735mr9884806pzc.54.1702427393916; Tue, 12 Dec 2023 16:29:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702427393; cv=none; d=google.com; s=arc-20160816; b=Vf3/RNBFC1DBOunw9gOeFErTnqXPxDcrIuq7b/EzQ5sCRXITuaW+xshAi9N+Hl+ExW tdqBAhQm7SxygCHT7+BBGJRXWc0BeHLVZqYLuBtxrY6Cxa72uBtvtM7pCDYogYIFY93z hvBYpglc0A2ltZ0BaQUVtemDZQ6FyO+cczN4QmmZNzi+v0wXCl5m8tl03+T0nRm1eC76 y6jLj4bB2AS6SYsE4Ceh6oBbaUb0UAWQ9nfQ4WzqMasGv4eXJHfzPZE2ad5HWksgQB3p exENwSe2Hv0bH4IU0MbIfhH0jVj1KcR3yLp356IRZ03mEzEPGo7Ul2eQRh8TaieQ8XOO QbvA== 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=T/CmYAMX8vCFXjdnC4Q6viaedqv85SFFc1KRj8TomIU=; fh=PBp7NmRIkq9t5wKlHybdcRNpwho5b6jr5EFConhaojU=; b=FinLPry7ZHvg2xx5D1dOyplRbr6kQJQduBLCXYvzIcmxLPGQ2upRg66ZUJZJVJXg4W vSAzAnNyAVla95a1FhPmfy2CYWtNzeTAR48GHo87cPubyg3dXlGB0pzIV6FVIYB+Xboj RD+o9R4aOGxaaneEhrx4nIjKedjq+UBjcz0rvP5iAc2Q62rRSjFw64raVM0/nndjbY9Y J7jHJnWndvkoeu4fpPohsU2xf5HrldTImGOMz3d3GsR4JiXwtTYkoj3LTiF6dyfMnIZg iPshP1QR3P94T5Xljrwa9ij8pO4jopLC8xY3RRH+/wW+JgTw2gPZdxWthFAa0zlD574T 0RIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U1lTHNBd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id z17-20020a056a00241100b006cde2f43c62si8352655pfh.354.2023.12.12.16.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 16:29:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U1lTHNBd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 5D422810DEDF; Tue, 12 Dec 2023 16:29:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232683AbjLMA3i (ORCPT + 99 others); Tue, 12 Dec 2023 19:29:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232620AbjLMA3h (ORCPT ); Tue, 12 Dec 2023 19:29:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FEAA92 for ; Tue, 12 Dec 2023 16:29:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AEAC4C433CB for ; Wed, 13 Dec 2023 00:29:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702427381; bh=T/CmYAMX8vCFXjdnC4Q6viaedqv85SFFc1KRj8TomIU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=U1lTHNBdDCfrLirRcsts086ScjN1mNZC14kBqKyHiQXz4nHbRfm98yMpDs2BYwQXl H2lhZRl4aHyHtzHVucT/E9ac6ebDMkjlj1ujGyvu1++E24zdw4dvxGqifgDA5oyzIc lIE43m+l2r1w3Utr+k0iH65TBtCqL+nq/VFf4taNt+l6X/YWh0oTwqzsn2ntOkuwLV OEFIi//KCt+3q1mUXF8gzw9L1/ja03+4AVSUmpSr78Vse4CcBYNnqFh0pLmC5MlwXm sL5VFIIdhVAmzDKqJALB5E7wt4FRUXV0z8pNFPYT7TnCxOaLDXiLzI9hngjCKu/WC1 xMicTkuENRaEQ== Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-1eb39505ba4so3806235fac.0 for ; Tue, 12 Dec 2023 16:29:41 -0800 (PST) X-Gm-Message-State: AOJu0YzbRbYAi63zF6Oete6wiZMemYcvamb65ajtlPPEij/4SATBW7w2 N/Q/SGZANUsRFgWWfooeq0Jr0c9Nq81fSXAMVgwjAg== X-Received: by 2002:a17:90b:3a8e:b0:285:adb0:de3e with SMTP id om14-20020a17090b3a8e00b00285adb0de3emr5846234pjb.34.1702427359763; Tue, 12 Dec 2023 16:29:19 -0800 (PST) MIME-Version: 1.0 References: <20231207192406.3809579-1-nphamcs@gmail.com> <20231209034229.GA1001962@cmpxchg.org> In-Reply-To: From: Chris Li Date: Tue, 12 Dec 2023 16:29:08 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6] zswap: memcontrol: implement zswap writeback disabling To: Nhat Pham Cc: Johannes Weiner , akpm@linux-foundation.org, tj@kernel.org, lizefan.x@bytedance.com, cerasuolodomenico@gmail.com, yosryahmed@google.com, sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com, mhocko@kernel.org, roman.gushchin@linux.dev, shakeelb@google.com, muchun.song@linux.dev, hughd@google.com, corbet@lwn.net, konrad.wilk@oracle.com, senozhatsky@chromium.org, rppt@kernel.org, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, david@ixit.cz, Kairui Song , Minchan Kim , 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 morse.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 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 16:29:51 -0800 (PST) On Tue, Dec 12, 2023 at 1:36=E2=80=AFPM Nhat Pham wrote= : > > Even if such a file were to show up, I'm not convinced it should even > > include zswap as one of the tiers. Zswap isn't a regular swap backend, > > it doesn't show up in /proc/swaps, it can't be a second tier, the way > > it interacts with its backend file is very different than how two > > swapfiles of different priorities interact with each other, it's > > already controllable with memory.zswap.max, etc. > > This is honestly the thing I was originally most iffy about :) zswap > is architecturally and semantically separate from other swap options. > It gets really confusing to lump it as part of the swap tiers. The writeback option is about interacting with other swap backends. So technically it is not zswap alone. writeback =3D 0 will disable SSD swap as well. I am not against merging the write back. I just want to make sure 1) better alternatives can be developed 2) zswap.writeback can obsolete if a better alternative is available. > > > > > I'm open to discussing usecases and proposals for more fine-grained > > per-cgroup backend control. We've had discussions about per-cgroup > > swapfiles in the past. Cgroup parameters for swapon are another > > thought. There are several options and many considerations. The > > memory.swap.tiers idea is the newest, has probably had the least > > amount of discussion among them, and looks the least convincing to me. > > Definitely. zswap.writeback is a really concrete feature, with > immediate use-case, whereas swap.tiers seem a bit nebulous to me now, > the more we discuss it. I'm not against the inclusion of something > along its line though, and I'm definitely not trying to limit the use > case of other folks - I'd be happy to contribute my engineering hours > towards the discussion of the multi-tier swapping design (both > internal implementation and and public interface), as well as actual > code, when that design is fully fleshed out :) Great to hear that. I think the discussion so far shows the alternative usage cases of the swap backend/tires is real. > > > > > Let's work out the requirements first. > > > > The "conflict" with memory.zswap.writeback is a red herring - it's no > > more of a conflict than setting memory.swap.tiers to "zswap" or "all" > > and then setting memory.zswap.max or memory.swap.max to 0. > > Yup. Care to elaborate it more? I don't understand the conflict part. I do ask Johannes in my previous email for clarification. One is the superset of the other. I don't consider that as a conflict. If we can have both to choose from, obviously I would pick the one that is more general and flexible. Chris