From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13E82C4332F for ; Tue, 5 Apr 2022 08:05:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E91B6B0071; Tue, 5 Apr 2022 04:05:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2991E6B0073; Tue, 5 Apr 2022 04:05:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 113196B0074; Tue, 5 Apr 2022 04:05:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0180.hostedemail.com [216.40.44.180]) by kanga.kvack.org (Postfix) with ESMTP id F3DB86B0071 for ; Tue, 5 Apr 2022 04:05:40 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9D257183A7193 for ; Tue, 5 Apr 2022 08:05:30 +0000 (UTC) X-FDA: 79322090820.24.27F6081 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf09.hostedemail.com (Postfix) with ESMTP id 28EFA140033 for ; Tue, 5 Apr 2022 08:05:30 +0000 (UTC) Received: by mail-ej1-f46.google.com with SMTP id i27so17874286ejd.9 for ; Tue, 05 Apr 2022 01:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Yyy8ZziaZgnmwLljTWyYhZF76iEy/skny2JVUymVUfc=; b=ZrPqW6X6T9AHIOoCE+8DXcGn6ONM3ECUQG7TA8kMbhD/l9G0Y5nl/2aIRaT4SRTqlJ iC7dDZTQEwT/ayXIVBtrvcfW3GdeHa2zVQON+czr57By8Bz0qkC8H5IaNBoxEbc8UWgz xFlGtjhVE7iZSxOYWyMsFOxQJgFA9YNX9booe1ijJGicN3y52sdh20P0e74Tk4nCLD6m G+qjItVnouOs6TR4SaQoEsLAZmfRWNgoDGL91oT0+yhSepn4IpC04eO2/33duVBa7OI7 TkCrxA766VbsxvW9Q5kVCNu0E919RJy/hMkBS+QXbPg5qhOKSArA3qETqjQ1Ll5wH347 Tbzg== 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:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Yyy8ZziaZgnmwLljTWyYhZF76iEy/skny2JVUymVUfc=; b=4wbt+8F1bBbh/UM0xa39kFKbbRH0mGdgwYBI8R9q+haaS3SMNuBrokYlpB8vFvzfIv zkmsHyArKM7rAe87OjtPDIL7LnECry9SiVWrmn3RO4FM2QTrgAynUbxlg5iFwEp3c/cI 5a76V2o90D8vL2+rwaeC0x7MfK7u8PbW1LIEATFVNBHhpqPqOYTE9Y4zdY7fFSsrofgD 7UdWEERjMdSg/9cx6OSWT9qUSRcKP+6zsDGGztJHb8EyiJ+b8rN0r0DtPWuOtxAQBH8Q MKePiE6XEc2x2ffB8OQ91qxfohT+UnSqjqPaBcdIXEOQArrK37NC6CmrSt3Dwbd2wfKe 2p+Q== X-Gm-Message-State: AOAM530EOo2JF8SQ4VXvKTf09zVBp8ZWl+FJifeCEDX9Ugdmb5Jm549t UhQuKjrNlWVmEy2nwIJzbqA= X-Google-Smtp-Source: ABdhPJxtPeDK1wQijISZPUqOP0D13mscIkjVUd8SzRqm4SJfpK3j0uuamT5f+ZtqTBncfQS3NXF1KQ== X-Received: by 2002:a17:907:2d2a:b0:6df:c027:a3ac with SMTP id gs42-20020a1709072d2a00b006dfc027a3acmr2172161ejc.179.1649145928749; Tue, 05 Apr 2022 01:05:28 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id d7-20020a170906174700b006e80a7e3111sm537587eje.17.2022.04.05.01.05.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Apr 2022 01:05:28 -0700 (PDT) Date: Tue, 5 Apr 2022 08:05:27 +0000 From: Wei Yang To: Michal Hocko Cc: Wei Yang , akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Roman Gushchin , Johannes Weiner Subject: Re: [PATCH] mm/memcg: non-hierarchical mode is deprecated Message-ID: <20220405080527.6eoziuwyfc76xvry@master> Reply-To: Wei Yang References: <20220403020833.26164-1-richard.weiyang@gmail.com> <20220405022218.53idmvm2ha2tzmy2@master> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: xsophez7cn9efhzoponrgehuty73wdua Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZrPqW6X6; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf09.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com X-Rspamd-Queue-Id: 28EFA140033 X-HE-Tag: 1649145930-630678 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Apr 05, 2022 at 08:26:59AM +0200, Michal Hocko wrote: >On Tue 05-04-22 02:22:18, Wei Yang wrote: >> On Mon, Apr 04, 2022 at 11:27:53AM +0200, Michal Hocko wrote: >> >On Sun 03-04-22 02:08:33, Wei Yang wrote: >> >> After commit bef8620cd8e0 ("mm: memcg: deprecate the non-hierarchical >> >> mode"), we won't have a NULL parent except root_mem_cgroup. And this >> >> case is handled when (memcg == root). >> >> >> >> Signed-off-by: Wei Yang >> >> CC: Roman Gushchin >> >> CC: Johannes Weiner >> > >> >Acked-by: Michal Hocko >> >Thanks! >> > >> >> Thanks for the ack. When reading the code, I found one redundant check in >> shrink_node_memcgs(). >> >> shrink_node_memcgs >> mem_cgroup_below_min >> mem_cgroup_supports_protection >> mem_cgroup_below_low >> mem_cgroup_supports_protection >> >> I am not sure it worthwhile to take it out. >> >> shrink_node_memcgs >> mem_cgroup_supports_protection >> mem_cgroup_below_min >> mem_cgroup_below_low >> >> Look forward your opinion. > >I guess you refer to mem_cgroup_is_root check in mem_cgroup_supports_protection, >right? > >You are right that the check is not really required because e{min,low} >should always stay at 0 for the root memcg AFAICS. On the other hand the >check is not in any hot path and it really adds clarity here because >protection is not really supported on the root memcg. So I am not this >is an overall win. Agree. >-- >Michal Hocko >SUSE Labs -- Wei Yang Help you, Help me