Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4380751rdb; Mon, 11 Dec 2023 18:44:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFlcrFf+XqUzGlxzdMnLqkzwJhXqofQQZQJZGsj8+n4s1Ebu/aGULz4WSuMxRNNFxSuLLd4 X-Received: by 2002:a17:902:ce8a:b0:1cf:cece:e96d with SMTP id f10-20020a170902ce8a00b001cfcecee96dmr7844705plg.0.1702349064330; Mon, 11 Dec 2023 18:44:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702349064; cv=none; d=google.com; s=arc-20160816; b=G140bvHrE9WnYHThg62G6kTtmIA9k5XAsfwsgWG9IuClFwyWNj0JkeJ6U0nY7l1Jn0 3PcOT3klp4DIE0iLl/xa4dkAPsD2PPRTH6NYQDEXSeEAoqZAS3K5qja4Ik5Uj2mrIk3X SKro4lxXwEPLfRN/+mWzr5t1F9a6+V89Qlk1ujvmZ6jnRzU4J+/0QjZXZNe0NkncWSz3 U125dTnQQDg4XLAb7Af9hh463qNUu0YDW3ukD2fAzsLM0NL5qgmK8C0jkS4Ja43SEzwa UtuUQlckCZ9bOpciqIx46YGRrM6Wnbn+IqkG//JqO6zFKU6H8gt9beajfVlglrf/s/jW efsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KaLk4QjiddLthhe61ZtqkCQM4vFUDEU82pA5JUhvoLM=; fh=SvWaBQJy+iBQ/y5+8RM4lWFbEslkcLBdVAo0dZYCHU4=; b=Z6neuMbprXFcxEAiTTS34h+jF1kgBJLdcL7+jE5D2kpwZT84mmXuTmv+yoGf2bitR6 8LYGTVHcI0T3xFeh5DkjAji2eTGgkDPy6elHeQ7kS/kRm7aIa78FtekSv3vKBgewNGZ1 TL6ihkon3ChOrP+0IBAEtXylh87bjklk38ZS8grCxxynlMGzRPS6c+EnNebcRibmmv+e xj1W6nSR49bg6G31c9LBvKm+3Gd0MK7oemaHV+02WpG2DCrKV260tBj7n9OQO+g42PCw DiN5jjQfo+GaXY2Ou9TGA7Juub5454iF/GztR4ma2XhZEdANty80ZgPdsT3jMA2/1qoK pCOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=DRVWl+3D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u18-20020a656712000000b005c6818b5a43si6925481pgf.506.2023.12.11.18.44.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 18:44:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=DRVWl+3D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E24838039DD9; Mon, 11 Dec 2023 18:44:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345607AbjLLCoH (ORCPT + 99 others); Mon, 11 Dec 2023 21:44:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbjLLCoG (ORCPT ); Mon, 11 Dec 2023 21:44:06 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD45BAD for ; Mon, 11 Dec 2023 18:43:51 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c9efa1ab7fso64322401fa.0 for ; Mon, 11 Dec 2023 18:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1702349030; x=1702953830; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KaLk4QjiddLthhe61ZtqkCQM4vFUDEU82pA5JUhvoLM=; b=DRVWl+3DcoFbLMdABJur0JARjpubyVJztXG7UplaOZueHlUBYlRrNtbOGsm+Vi92PM RX02DKtc+MSLwfGDSygaR14iIhkGSg8sHnpyDO5B356e5yHjLJtf1rEQEFUcQFooV8cT AK8X5FJBTbLW9aG0e0ZGDKd9UqTPrYx+jY1UHcgNQeHlUA2aHTbUUYFs3c2mOOgm+9Ht c8HawJkMZTahh4iiDPWJ+46q8Wtit1zqjxwx1pDk+Mcz8MzPT/Bjz/+gTqqlUbsXmn4X G6/8vFCqbHYDzRRUWKDhYcgSsxfBQ0ffCmpd1ZpEZON+q2bg6V3o38WBD7aBLmwt8ah0 MoJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702349030; x=1702953830; h=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=KaLk4QjiddLthhe61ZtqkCQM4vFUDEU82pA5JUhvoLM=; b=hVylIkCVzJ6ApsFZ4jd0/WeGcNmC5oMRtVYtWv2KWywwBDWVDnbSVS+BdQMa5VtD7o p7CJPL5fmO5auhSvDjt2dQfnJ2sQRIIQbEG+55t98HbB5JvGEMHzkckWUPY6GHBj9yke 1msK2FML8lMv9lWxZ0Vbsr8eA8wvHjFajdwZAM0kjEGnebBvceU56eEnZSpXWY0JrL8F 59+X6QD7lPC427XdzROZEbWGMoqn0TC8e0OHOLurJFfa5G+kKflwwoLh/zFlkTkLPkJl Byp1tw7KltfPqXNrKXMlG5wyzUi86AMe9ouQ+QzRdwgmeHnXo2PmW8eUAxN05wLIM71Y 3MAw== X-Gm-Message-State: AOJu0Ywnepf1pSwF9KQMt20K6kizRyDX0OpkVVqmdls2LjtsWQ/F/3vy timk7iyjGjyrbc3NPb0IWRJ4x6TyFJodrAnUmNyZxw== X-Received: by 2002:a2e:9619:0:b0:2ca:760:bc55 with SMTP id v25-20020a2e9619000000b002ca0760bc55mr880262ljh.209.1702349029948; Mon, 11 Dec 2023 18:43:49 -0800 (PST) MIME-Version: 1.0 References: <20231207192406.3809579-1-nphamcs@gmail.com> <20231209034229.GA1001962@cmpxchg.org> In-Reply-To: From: Zhongkun He Date: Tue, 12 Dec 2023 10:43:38 +0800 Message-ID: Subject: Re: [External] Re: [PATCH v6] zswap: memcontrol: implement zswap writeback disabling To: Minchan Kim Cc: Johannes Weiner , Chris Li , Nhat Pham , 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Mon, 11 Dec 2023 18:44:22 -0800 (PST) > Hi Johannes, > > I haven't been following the thread closely, but I noticed the discussion > about potential use cases for zram with memcg. > > One interesting idea I have is to implement a swap controller per cgroup. > This would allow us to tailor the zram swap behavior to the specific needs of > different groups. Hi Minchan, It would be great if this feature could be in place. We are using zram and also trying to use zswap to offload memory to disk. As kairui mentioned above, there are many workloads of varying priority and sensitivity on a machine. > > For example, Group A, which is sensitive to swap latency, could use zram swap > with a fast compression setting, even if it sacrifices some compression ratio. > This would prioritize quick access to swapped data, even if it takes up more space. > > On the other hand, Group B, which can tolerate higher swap latency, could benefit > from a slower compression setting that achieves a higher compression ratio. > This would maximize memory efficiency at the cost of slightly slower data access. > > This approach could provide a more nuanced and flexible way to manage swap usage > within different cgroups. Indeed.