From: Michal Hocko <mhocko@suse.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, cgroups@vger.kernel.org,
linux-mm@kvack.org, Roman Gushchin <roman.gushchin@linux.dev>,
Johannes Weiner <hannes@cmpxchg.org>
Subject: Re: [PATCH] mm/memcg: non-hierarchical mode is deprecated
Date: Tue, 5 Apr 2022 08:26:59 +0200 [thread overview]
Message-ID: <YkvhMx2EVVisfjRG@dhcp22.suse.cz> (raw)
In-Reply-To: <20220405022218.53idmvm2ha2tzmy2@master>
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 <richard.weiyang@gmail.com>
> >> CC: Roman Gushchin <roman.gushchin@linux.dev>
> >> CC: Johannes Weiner <hannes@cmpxchg.org>
> >
> >Acked-by: Michal Hocko <mhocko@suse.com>
> >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.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2022-04-05 6:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-03 2:08 Wei Yang
2022-04-04 9:27 ` Michal Hocko
2022-04-05 2:22 ` Wei Yang
2022-04-05 6:26 ` Michal Hocko [this message]
2022-04-05 8:05 ` Wei Yang
2022-04-04 19:11 ` Roman Gushchin
2022-04-05 18:20 ` Shakeel Butt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YkvhMx2EVVisfjRG@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=richard.weiyang@gmail.com \
--cc=roman.gushchin@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox