Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4727155rdh; Wed, 29 Nov 2023 09:01:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IFniJWo4rLW9HsFit/HYmUq2PHb88KS4cPkKKM5jjm6JCJvrzEU2KQTLjTwPpftVDYaoneT X-Received: by 2002:a05:6808:6489:b0:3b6:cb49:e6d4 with SMTP id fh9-20020a056808648900b003b6cb49e6d4mr20142554oib.57.1701277300579; Wed, 29 Nov 2023 09:01:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701277300; cv=none; d=google.com; s=arc-20160816; b=oTP8bAdHNDEjwW7keecCfifHOGYaPi3NTbZqTqKqklz0qypy48JWKD1wSfiJSrOWeR l2zmw7zTxElOUB1LJ/qkOxXK2knituzPtCdFflVzAkocD043tWCfjIRyKOUyBq7tZ+CI bdGltw8lFXou/Y/Xg0PVE5a9craJ/b3g6V6qMkPEE81sAyXhFQia/RFnDcyNOb/zAU6X 7NGn1x5MTVESJDxO5FcS3Iq17WM84DyqX6qIxyPdhvwMGTh43Xd9jvykqx9wB6/WHQUR h/n9KLpns7leJ04qAmZpIwNhZssh/bd3wepDFqKBhlhIE7JiX/Y/W+lvRACe6WrrWMyn Obgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=U8mgkS00IbNP5jyZ+NO8ODgKFBs6g0ytgBOeKMTZ8ns=; fh=dnuTZ7lF+HScHO+ErJYG5fxqkNw/sSQkqUZDMo0Tq8Q=; b=T1O3GYCobAn9/0bddw6xrALBjwfQ6Y2Hs/i/9HWV1Ys6Qd5+Ub/cZjQnB0eo+SKRet 1Fuso4F6o8lM95dxUOMTE7sbN9geOj6egEkEzlKFPLgTRw4OegMWTlu09IW+hOQnwObc +fKJ8c0mGdCOqL6oSmkCkmV0eOShABYoMnDbIews9trhLlpls1TeAQoyQZypVL0OaNFW 31FB1B3TXTMear5jOhfRwv8dm0f8TAZYmcnF/dKBVyvb3b/nLl0sc33vNYP4sY+7PnLD VsEVVjQ7PIkshXYT6zH2rmd3LMJJoRrKK9vm//vnx3xDdDhdyAhoG/eb7A/qmiT5oObb u6pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=Cc5TfHiv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id j10-20020a056808118a00b003b2df61bc76si5906822oil.180.2023.11.29.09.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:01:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=Cc5TfHiv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 1FDE7807BED4; Wed, 29 Nov 2023 09:00:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232631AbjK2Q77 (ORCPT + 99 others); Wed, 29 Nov 2023 11:59:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231295AbjK2Q75 (ORCPT ); Wed, 29 Nov 2023 11:59:57 -0500 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80314DC for ; Wed, 29 Nov 2023 09:00:03 -0800 (PST) Received: by mail-qk1-x733.google.com with SMTP id af79cd13be357-7788ebea620so357048285a.3 for ; Wed, 29 Nov 2023 09:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1701277202; x=1701882002; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=U8mgkS00IbNP5jyZ+NO8ODgKFBs6g0ytgBOeKMTZ8ns=; b=Cc5TfHivfaAnMCl2wCcKTmQ8V6KSXeBQ94Qc/hQQqHLMx94l/6q7kPVNFzn7Dor7Om 6r5o64nLBMpemmWLPtav/sto+wf49O3ontvSa18PfOd0XXjiMnKZtOqqCXk4x/3rwyzH hQurXNSbwCRv1XenKKEVXvAtxgRL+DXNm9JeEvd+/mwrPPmI5BU/y6SAEoauTneFXVNz iAL1/AENwaUWINoEwMac8Z93ItWqw77TbXbLuXyx+HAL5Iq7+JhO6rV8OxiIGkr454FE 5t/LT3LM3bnUyefxYAHxY4BKVtLnyH7KYRruznsMa0lB7/xjGjzc+fVK8VK3xX62Nax9 GazQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701277202; x=1701882002; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=U8mgkS00IbNP5jyZ+NO8ODgKFBs6g0ytgBOeKMTZ8ns=; b=npfD0/412PaV19vfAI1QGCxjEUaOARgsGp0hcyqZy+N4IbwpHP6H7tg7cI87wL3YBu dfmo5hdxZ5wE+jJEn9dGYJz/EKlTxJ3L1WUSIrdCZsHXCTDEtUo7qxxbVICMDAxIpsYy lmkU5h/N0ebVCAk9PAEOkGvlZOgmA1yfp6br/E4qRmj1KleQeJvmmuAUqXdr5eeC7ub/ rDbA8qXCyVrlH6nMktquv2u/8sC1WZ0qIJIK1bB4md74OOP1IcE2dBigRhRAZypNuv+l iT2g8hFQQgre1lJozqy/uG8TJnEBqxWcEATUys43A1LHA76GGoTIPx5W2wzYLSZrcZbi wjKg== X-Gm-Message-State: AOJu0YxY82gz+QGZfjPqjhJ0UyaIS3yJjhT8xz7LCNYJfL2RyW3XxrJE 8y96b4Q5HQpNMBnS8MxRhzzHuw== X-Received: by 2002:a05:620a:2707:b0:77d:a0ee:f196 with SMTP id b7-20020a05620a270700b0077da0eef196mr14597254qkp.5.1701277202618; Wed, 29 Nov 2023 09:00:02 -0800 (PST) Received: from localhost ([2620:10d:c091:400::5:ffba]) by smtp.gmail.com with ESMTPSA id rg7-20020a05620a8ec700b0077d8622ee6csm4397763qkn.81.2023.11.29.09.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:00:02 -0800 (PST) Date: Wed, 29 Nov 2023 12:00:01 -0500 From: Johannes Weiner To: Nhat Pham Cc: akpm@linux-foundation.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 v7 2/6] memcontrol: add a new function to traverse online-only memcg hierarchy Message-ID: <20231129170001.GF135852@cmpxchg.org> References: <20231127234600.2971029-1-nphamcs@gmail.com> <20231127234600.2971029-3-nphamcs@gmail.com> <20231129150403.GB135852@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231129150403.GB135852@cmpxchg.org> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 09:00:22 -0800 (PST) On Wed, Nov 29, 2023 at 10:04:05AM -0500, Johannes Weiner wrote: > On Mon, Nov 27, 2023 at 03:45:56PM -0800, Nhat Pham wrote: > > The new zswap writeback scheme requires an online-only memcg hierarchy > > traversal. Add this functionality via the new mem_cgroup_iter_online() > > function - the old mem_cgroup_iter() is a special case of this new > > function. > > > > Suggested-by: Andrew Morton > > Signed-off-by: Nhat Pham > > Acked-by: Johannes Weiner I saw Michal's reply on the other thread only after I sent this. I agree with him it would be better to just check mem_cgroup_online() in the shinker callsite and leave mem_cgroup_iter() as-is. If it's offline, just continue to the next mem_cgroup_iter() invocation.