Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3413399rdh; Mon, 27 Nov 2023 13:43:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFib8qgWKJA21IozOnZLsLPGYqx7JLXJXmh67YR04mZeBEYFOaae+gzOQeQypffOr6vedTr X-Received: by 2002:a17:90b:3884:b0:285:d803:8945 with SMTP id mu4-20020a17090b388400b00285d8038945mr4211674pjb.46.1701121393572; Mon, 27 Nov 2023 13:43:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701121393; cv=none; d=google.com; s=arc-20160816; b=g9Ro5spRm9+5d5OT+n9cVTOnMR1bITGpfdfJElI/mpXegXaoplpqqL+aMt1AoxkBvq 14zdNchY8y0XJ9WXVoa1UV9uT2IssuqnN4HOUlvU479eEW8tDMto3xPVpdUH009bysr8 cSNWwblyRQN/5p3c+zaGE328cDuXZDiylb1wji2foXITp0J2dTKgt9DXcwqyomZEV+lV E2sNGlbyfGZk1c9Rrn79/NIVdWng8rQnGXIrf9upLBS+tOVYOEcdSOnO3PJrvtHp3MjF I5m14h2qtTUeKTAQu+ZKEP9GpaOMJwO8ycFmNvmCovdsc75q9zenRsz2zD7WfFrs7613 vuCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=gEpbcQ7rfwN5p4EmqqQY+zarCT+chYj0E60/HtzFT9I=; fh=l8Ska0tqZdzKUD0P745nL2eS+RMZEL3Hi5UmK1nn4ao=; b=EzyUa8F3pOH4QmlPwMiH2LfhBjwDx1tQNhxyBq7szqVQZtP31cJ2q4QMUxxx1W5L5b yqxb02wCnFGtbqb/rutofuZR4HZCWWWrlX9TPGtYA/lbDk7iWIpUy45VYOrn0CwWab+e dW3w1iChYKufvw+daP9As4NJp4jokD4TVkj6eQw2UkTrPTLW7JZbJlKgrIkb4dLUzoEP MSXxsnzzcJXPj131/kvsV+Pj8BoacLIv3euZKAu/Q8t1b4EuMA+j3Kdn15jmnbixV/hQ A7mNHYOB25DsLBPnO9Xt97Hfc92/Ximj2OQwFK9VkftxfQcyBBn5dSSL5kG0Ux2o4xFc w2EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=RERa00m1; 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 Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id q15-20020a17090311cf00b001cfb1e11624si7238768plh.54.2023.11.27.13.43.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 13:43:13 -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=@linux-foundation.org header.s=korg header.b=RERa00m1; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id D15E9818597E; Mon, 27 Nov 2023 13:43:10 -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 S233050AbjK0Vm4 (ORCPT + 99 others); Mon, 27 Nov 2023 16:42:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232683AbjK0Vmy (ORCPT ); Mon, 27 Nov 2023 16:42:54 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51801131 for ; Mon, 27 Nov 2023 13:43:01 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A920C433C7; Mon, 27 Nov 2023 21:43:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1701121380; bh=CoO2w1Aaayjts+dtvAb8Eh6H5/dRtPDx1TPM+uYjYAI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RERa00m1APTZ4nW8M04Rfr5i0iygE8BDQ0e6DmhSMgrHZ7Jw8YuA+xtP69/WxezsS rJMo7RPAVGmSaP6y2uf2uCKw0+eW38cOjgSScmhCD+QpioQ4N661eUERXRrVP0Lsvr wLF7BGf+jgv/d4EqPdkzSwHborOYqRliIGg2SYhE= Date: Mon, 27 Nov 2023 13:42:59 -0800 From: Andrew Morton To: Nhat Pham Cc: hannes@cmpxchg.org, 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, chrisl@kernel.org, linux-mm@kvack.org, kernel-team@meta.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org Subject: Re: [PATCH v6 2/6] memcontrol: allows mem_cgroup_iter() to check for onlineness Message-Id: <20231127134259.67b69ab47f4f88c9751e5222@linux-foundation.org> In-Reply-To: <20231127193703.1980089-3-nphamcs@gmail.com> References: <20231127193703.1980089-1-nphamcs@gmail.com> <20231127193703.1980089-3-nphamcs@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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, 27 Nov 2023 13:43:11 -0800 (PST) On Mon, 27 Nov 2023 11:36:59 -0800 Nhat Pham wrote: > The new zswap writeback scheme requires an online-only memcg hierarchy > traversal. Add a new parameter to mem_cgroup_iter() to check for > onlineness before returning. I get a few build errors, perhaps because of patch timing issues... mm/shrinker_debug.c: In function 'shrinker_debugfs_count_show': mm/shrinker_debug.c:64:17: error: too few arguments to function 'mem_cgroup_iter' 64 | memcg = mem_cgroup_iter(NULL, NULL, NULL); | ^~~~~~~~~~~~~~~ In file included from mm/shrinker_debug.c:7: ./include/linux/memcontrol.h:833:20: note: declared here 833 | struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *, | ^~~~~~~~~~~~~~~ mm/shrinker_debug.c:89:27: error: too few arguments to function 'mem_cgroup_iter' 89 | } while ((memcg = mem_cgroup_iter(NULL, memcg, NULL)) != NULL); | ^~~~~~~~~~~~~~~ ./include/linux/memcontrol.h:833:20: note: declared here 833 | struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *, | ^~~~~~~~~~~~~~~ mm/damon/sysfs-schemes.c: In function 'damon_sysfs_memcg_path_to_id': mm/damon/sysfs-schemes.c:1594:22: error: too few arguments to function 'mem_cgroup_iter' 1594 | for (memcg = mem_cgroup_iter(NULL, NULL, NULL); memcg; | ^~~~~~~~~~~~~~~ In file included from ./include/linux/damon.h:11, from mm/damon/sysfs-common.h:8, from mm/damon/sysfs-schemes.c:10: ./include/linux/memcontrol.h:833:20: note: declared here 833 | struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *, | ^~~~~~~~~~~~~~~ mm/damon/sysfs-schemes.c:1595:33: error: too few arguments to function 'mem_cgroup_iter' 1595 | memcg = mem_cgroup_iter(NULL, memcg, NULL)) { | ^~~~~~~~~~~~~~~ ./include/linux/memcontrol.h:833:20: note: declared here 833 | struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *, | ^~~~~~~~~~~~~~~ > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -832,7 +832,7 @@ static inline void mem_cgroup_put(struct mem_cgroup *memcg) > > struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *, > struct mem_cgroup *, > - struct mem_cgroup_reclaim_cookie *); > + struct mem_cgroup_reclaim_cookie *, bool online); How many callsites do we expect to utilize the new `online' argument? Few, I suspect. How about we fix the above and simplify the patch by adding a new mem_cgroup_iter_online() and make mem_cgroup_iter() a one-line wrapper which calls that and adds the online=false argument? I also saw this, didn't investigate. drivers/android/binder_alloc.c: In function 'binder_update_page_range': drivers/android/binder_alloc.c:237:34: error: too few arguments to function 'list_lru_del' 237 | on_lru = list_lru_del(&binder_alloc_lru, &page->lru);