Skip to content

Commit

Permalink
mm/memcontrol.c: replace cgroup_memory_nokmem with mem_cgroup_kmem_di…
Browse files Browse the repository at this point in the history
…sabled()

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/[email protected]
Signed-off-by: Xiang Yang <[email protected]>
Reviewed-by: Muchun Song <[email protected]>
Acked-by: Roman Gushchin <[email protected]>
Acked-by: Souptick Joarder (HPE) <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Shakeel Butt <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
Xiang Yang authored and akpm00 committed Jul 18, 2022
1 parent 01b4445 commit 9c94bef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -3653,7 +3653,7 @@ static int memcg_online_kmem(struct mem_cgroup *memcg)
{
struct obj_cgroup *objcg;

if (cgroup_memory_nokmem)
if (mem_cgroup_kmem_disabled())
return 0;

if (unlikely(mem_cgroup_is_root(memcg)))
Expand All @@ -3677,7 +3677,7 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg)
{
struct mem_cgroup *parent;

if (cgroup_memory_nokmem)
if (mem_cgroup_kmem_disabled())
return;

if (unlikely(mem_cgroup_is_root(memcg)))
Expand Down

0 comments on commit 9c94bef

Please sign in to comment.