diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2014-12-12 19:54:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-13 15:42:46 -0500 |
commit | 9d100c5e470eaeee5809da289f22b0de165de6b2 (patch) | |
tree | 1ae444940e47ef41586c1370aff451224117cfa5 /mm/memcontrol.c | |
parent | bfda7e8fe428ff4a42653d7b117d4598fc446cda (diff) |
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 <vdavydov@parallels.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 4 |
1 files changed, 2 insertions, 2 deletions
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, | |||
2856 | VM_BUG_ON(!cachep->memcg_params); | 2856 | VM_BUG_ON(!cachep->memcg_params); |
2857 | VM_BUG_ON(!cachep->memcg_params->is_root_cache); | 2857 | VM_BUG_ON(!cachep->memcg_params->is_root_cache); |
2858 | 2858 | ||
2859 | if (!current->mm || current->memcg_kmem_skip_account) | 2859 | if (current->memcg_kmem_skip_account) |
2860 | return cachep; | 2860 | return cachep; |
2861 | 2861 | ||
2862 | rcu_read_lock(); | 2862 | rcu_read_lock(); |
@@ -2942,7 +2942,7 @@ __memcg_kmem_newpage_charge(gfp_t gfp, struct mem_cgroup **_memcg, int order) | |||
2942 | * allocations are extremely rare but can happen, for instance, for the | 2942 | * allocations are extremely rare but can happen, for instance, for the |
2943 | * cache arrays. We bring this test here. | 2943 | * cache arrays. We bring this test here. |
2944 | */ | 2944 | */ |
2945 | if (!current->mm || current->memcg_kmem_skip_account) | 2945 | if (current->memcg_kmem_skip_account) |
2946 | return true; | 2946 | return true; |
2947 | 2947 | ||
2948 | memcg = get_mem_cgroup_from_mm(current->mm); | 2948 | memcg = get_mem_cgroup_from_mm(current->mm); |