diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 5af38d8a9afd..3a3d109dce21 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2678,7 +2678,7 @@ int memcg_kmem_charge(struct page *page, gfp_t gfp, int order) struct mem_cgroup *memcg; int ret = 0; - if (memcg_kmem_bypass()) + if (mem_cgroup_disabled() || memcg_kmem_bypass()) return 0; memcg = get_mem_cgroup_from_current();