diff options
author | Yang Shi <yang.shi@linux.alibaba.com> | 2020-04-02 06:10:02 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-04-02 18:35:31 +0200 |
commit | d8a1c03ff797050b4310bd34b5ef5c0d5c7491e6 (patch) | |
tree | 4ac8ad5edffb4788e798dcfc5e5afed3b9544a0d /mm | |
parent | mm: vmpressure: don't need call kfree if kstrndup fails (diff) | |
download | linux-d8a1c03ff797050b4310bd34b5ef5c0d5c7491e6.tar.xz linux-d8a1c03ff797050b4310bd34b5ef5c0d5c7491e6.zip |
mm: vmpressure: use mem_cgroup_is_root API
Use mem_cgroup_is_root() API to check if memcg is root memcg instead of
open coding.
Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: David Rientjes <rientjes@google.com>
Link: http://lkml.kernel.org/r/1581398649-125989-2-git-send-email-yang.shi@linux.alibaba.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmpressure.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 0590f0033448..d69019fc3789 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); |