]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled()
authorXiang Yang <xiangyang3@huawei.com>
Sat, 25 Jun 2022 06:18:44 +0000 (14:18 +0800)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 20 Jul 2022 00:15:13 +0000 (20:15 -0400)
mem_cgroup_kmem_disabled() checks whether the kmem accounting is off.
Therefore, replace cgroup_memory_nokmem with mem_cgroup_kmem_disabled(),
which is the same work in percpu.c and slab_common.c.

Link: https://lkml.kernel.org/r/20220625061844.226764-1-xiangyang3@huawei.com
Signed-off-by: Xiang Yang <xiangyang3@huawei.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Acked-by: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Shakeel Butt <shakeelb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c

index 35f83822ab03aae09cb12fca8fe9a867d668fee8..92bf77c551bd170c78dd0805d1dc7b117badfc39 100644 (file)
@@ -3783,7 +3783,7 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css,
 #ifdef CONFIG_MEMCG_KMEM
 static int memcg_online_kmem(struct mem_cgroup *memcg)
 {
-       if (cgroup_memory_nokmem)
+       if (mem_cgroup_kmem_disabled())
                return 0;
 
        if (unlikely(mem_cgroup_is_root(memcg)))
@@ -3798,7 +3798,7 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
 
 static void memcg_offline_kmem(struct mem_cgroup *memcg)
 {
-       if (cgroup_memory_nokmem)
+       if (mem_cgroup_kmem_disabled())
                return;
 
        if (unlikely(mem_cgroup_is_root(memcg)))