From: Vladimir Davydov Date: Sat, 13 Dec 2014 00:54:53 +0000 (-0800) Subject: memcg: don't check mm in __memcg_kmem_{get_cache,newpage_charge} X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9d100c5e470eaeee5809da289f22b0de165de6b2;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git memcg: don't check mm in __memcg_kmem_{get_cache,newpage_charge} We already assured the current task has mm in memcg_kmem_should_charge, no need to double check. Signed-off-by: Vladimir Davydov Cc: Johannes Weiner Cc: Michal Hocko Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index e8bf0fc356b2..37f345e64fda 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2856,7 +2856,7 @@ struct kmem_cache *__memcg_kmem_get_cache(struct kmem_cache *cachep, VM_BUG_ON(!cachep->memcg_params); VM_BUG_ON(!cachep->memcg_params->is_root_cache); - if (!current->mm || current->memcg_kmem_skip_account) + if (current->memcg_kmem_skip_account) return cachep; rcu_read_lock(); @@ -2942,7 +2942,7 @@ __memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **_memcg, int order) * allocations are extremely rare but can happen, for instance, for the * cache arrays. We bring this test here. */ - if (!current->mm || current->memcg_kmem_skip_account) + if (current->memcg_kmem_skip_account) return true; memcg = get_mem_cgroup_from_mm(current->mm);