Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4008956ioo; Wed, 25 May 2022 12:44:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3vqIO2UKcNd9ZlYy7sukpTbn+Q+1mIMV7v+umbLac2cBPNK5aJfAH6a4CJE69YKQfpenq X-Received: by 2002:aa7:cc01:0:b0:42a:402b:b983 with SMTP id q1-20020aa7cc01000000b0042a402bb983mr36244913edt.257.1653507882995; Wed, 25 May 2022 12:44:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653507882; cv=none; d=google.com; s=arc-20160816; b=obd3bLJFRFaq2tpWu6Bd10jXjmwsw6OSUr0y2sSh1Sc2Etr5vEbfxdCLCF9xJcYyms 7mzpzR4n40ELbjHOcErw6ofjskjk8zGv55Zlv7oSbudamXs1XcxSLXRSVEkAbSuSC45Y GEAdzeIgBedfBmR07Dfj1AjI+KaxYYF9t/w95mBD9aZgSG0IFF7scUCLcLXfLOpDquLf kgRjksVyPCYof8ebRDRfXJHRNvLM0ufeW013psywkYU+jHtTdQYIBuuRa1eQ4hdCbIO1 wNY4o66vkWZQ0qiOm+wIR3xM6y59hG3U+X4VBwCQ3w29cm+RvpbT5WE/y/jKvdNpWt7U AFWg== 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=6TZc5omLz/Jq7pdQu2KMjXRAJ+8quAYgmF0qQ6A24hk=; b=GGqanuMoavyboEeldGcQ9w2KhqheQ0S223OKQzCofMXZTI1KJxCTVQUs3mttzg2Sqk 3vxptK1GSnYCa2mruGEQnH+L2HGpOhHMEHPG2MVLOf12NK8OxQKvqGYzEtd6MAk6KU1m Uimk7u/dCc2iqtdGrlrXUnFDTOneJtvyMNsW059JGDgukAMRddpGKSpnvclQJI5JOvh0 3ECQ41ki2HPe+CIZ2wYdi3Xi0N7eo5pr+JScg2lwNgMogFkMA5iTraHwY2eGQ1lDDZkP QbJCJKP2OrIogz/b3rduni9wPkJ0oOm8QnAppgifR8hNEfEvChGZ3aG6p0Ob6+wsrwLu MLgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=QY59JJr7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp36-20020a1709073e2400b006f3b8a62ff1si21406583ejc.123.2022.05.25.12.44.15; Wed, 25 May 2022 12:44:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20210112.gappssmtp.com header.s=20210112 header.b=QY59JJr7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238439AbiEYMiF (ORCPT + 99 others); Wed, 25 May 2022 08:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiEYMiE (ORCPT ); Wed, 25 May 2022 08:38:04 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D35A77A821 for ; Wed, 25 May 2022 05:38:00 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id p8so533402qtx.9 for ; Wed, 25 May 2022 05:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6TZc5omLz/Jq7pdQu2KMjXRAJ+8quAYgmF0qQ6A24hk=; b=QY59JJr7TItWYVE8/m9ruAVMHFqijACLGhysmIiQ0darsQg/VQAoJB8gF2m9BF41wz /Rd0O1W076eZNqnGHu+DAxpqOcIiVcSLvKUEJhqY5OvDGbpFy0ESGC/p0jK+bP/sZRHW YNyl6oYfbkJuFFI6vKpdAcbbhDbc+4NhyBATsREKtv7w8AFx45S9N8cPppNXnNRlDe2Y ne1zDiEaRvCpbvIraoD3UJZCi+i5D7sCQ1Fx97kmRCaKSd2nKy8uX0l6sSmwKWrK8mEJ OJtY07A4EPFFeowbysgfs+AsI1e7SZbI3MrQiHJ9fZAJee4hJExZh8khNM6L17ZOG7ue zwdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6TZc5omLz/Jq7pdQu2KMjXRAJ+8quAYgmF0qQ6A24hk=; b=mnFy2le2iEiQulBE8pKPLeWvUbJpt8UkQIWmKEFor1CNeumhyarClyDOX1YBNO5s7O Uzb32R0Vmen/r5MiZjEZyUN/sGvwZO0uNB7DfKLvfalhgw0CvXyxvEQygqU3tvowmeeI MwQuHv/bmEF/ikv8Rhxt7HQiCIJTjOk0WXNGSAz2hwcR4huzbhDTMkRKjOLqvB5o3Tb4 DhG5NoiMyS3z/GMNmIX0YVL9Q270HfmLZeGRmYgNK31mTFPhq2A89qGSBMCEhKdePF6n 6n1wgc0Um2j7J0D886g+DisGGqt4uuM2sGR0/ZhiuA1s8UaTXHJhV72q3UuiuNlW5BNK +rqA== X-Gm-Message-State: AOAM5311ys1SFWwqbAk3dois1CNZtbZiB0DL4Y44BzGzr+SxNAKeMEoi pH8wPqq7m6qLlOv9ze0MmsEVew== X-Received: by 2002:a05:622a:248:b0:2f9:3ea2:c11d with SMTP id c8-20020a05622a024800b002f93ea2c11dmr8378034qtx.600.1653482279980; Wed, 25 May 2022 05:37:59 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:741f]) by smtp.gmail.com with ESMTPSA id g11-20020ac8774b000000b002f90a33c78csm1219613qtu.67.2022.05.25.05.37.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 May 2022 05:37:59 -0700 (PDT) Date: Wed, 25 May 2022 08:37:58 -0400 From: Johannes Weiner To: Muchun Song Cc: Roman Gushchin , mhocko@kernel.org, shakeelb@google.com, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, duanxiongchun@bytedance.com, longman@redhat.com Subject: Re: [PATCH v4 01/11] mm: memcontrol: prepare objcg API for non-kmem usage Message-ID: References: <20220524060551.80037-1-songmuchun@bytedance.com> <20220524060551.80037-2-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 On Wed, May 25, 2022 at 03:57:17PM +0800, Muchun Song wrote: > On Tue, May 24, 2022 at 07:36:24PM -0700, Roman Gushchin wrote: > > On Tue, May 24, 2022 at 02:05:41PM +0800, Muchun Song wrote: > > > - memcg_reparent_list_lrus(memcg, parent); > > > + memcg_reparent_list_lrus(memcg, parent_mem_cgroup(memcg)); > > We effectively dropped this: > > if (!parent) > > parent = root_mem_cgroup; > > Is it safe? (assuming v1 non-hierarchical mode, it's usually when all > > is getting complicated) Yes, it's correct. But it's a quiet, incidental cleanup, so I can see why it's confusing. It might be better to split the dead code removal into a separate patch - with the following in the changelog ;): > Since no-hierarchy mode is deprecated after commit bef8620cd8e0 > ("mm: memcg: deprecate the non-hierarchical mode"), so > parent_mem_cgroup() cannot return a NULL except root memcg, > however, root memcg will not be offline, so it is safe. Right?