From: Yang Shi <yang.shi@linux.alibaba.com>
To: Michal Hocko <mhocko@kernel.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] mm: vmpressure: use mem_cgroup_is_root API
Date: Wed, 12 Feb 2020 19:18:59 -0800 [thread overview]
Message-ID: <94323469-c9d5-33ab-318b-2677dd966a92@linux.alibaba.com> (raw)
In-Reply-To: <20200212082346.GB11353@dhcp22.suse.cz>
On 2/12/20 12:23 AM, Michal Hocko wrote:
> On Tue 11-02-20 13:24:09, Yang Shi wrote:
>> Use mem_cgroup_is_root() API to check if memcg is root memcg instead of
>> open coding.
> Yes, the direct use outside of memcontrol.c should be really an
> exception. The only other similar case is cgwb_bdi_init and there is no
> easy way to replace - except for adding a helper which is not worth it.
Yes, it seems so. cgwb_bdi_init just deferences root_mem_cgroup to
access its css. It is the only user outside memcontrol.c, so I agree a
helper for it might be overkilling. Once we have more users, it should
be considered.
>
>> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
> Acked-by: Michal Hocko <mhocko@suse.com>
Thanks.
>
> Thanks!
>
>> ---
>> mm/vmpressure.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/mm/vmpressure.c b/mm/vmpressure.c
>> index 0590f00..d69019f 100644
>> --- a/mm/vmpressure.c
>> +++ b/mm/vmpressure.c
>> @@ -280,7 +280,7 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, bool tree,
>> enum vmpressure_levels level;
>>
>> /* For now, no users for root-level efficiency */
>> - if (!memcg || memcg == root_mem_cgroup)
>> + if (!memcg || mem_cgroup_is_root(memcg))
>> return;
>>
>> spin_lock(&vmpr->sr_lock);
>> --
>> 1.8.3.1
>>
next prev parent reply other threads:[~2020-02-13 3:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 5:24 [PATCH 1/2] mm: vmpressure: don't need call kfree if kstrndup fails Yang Shi
2020-02-11 5:24 ` [PATCH 2/2] mm: vmpressure: use mem_cgroup_is_root API Yang Shi
2020-02-12 2:08 ` David Rientjes
2020-02-12 8:23 ` Michal Hocko
2020-02-13 3:18 ` Yang Shi [this message]
2020-02-12 11:19 ` David Hildenbrand
2020-02-12 2:07 ` [PATCH 1/2] mm: vmpressure: don't need call kfree if kstrndup fails David Rientjes
2020-02-12 11:21 ` David Hildenbrand
2020-02-13 3:14 ` Yang Shi
2020-02-13 4:48 ` Andrew Morton
2020-02-13 4:51 ` Yang Shi
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=94323469-c9d5-33ab-318b-2677dd966a92@linux.alibaba.com \
--to=yang.shi@linux.alibaba.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).