mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 14:19:16 +00:00
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>
This commit is contained in:
parent
bfda7e8fe4
commit
9d100c5e47
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
VM_BUG_ON(!cachep->memcg_params->is_root_cache);
|
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;
|
return cachep;
|
||||||
|
|
||||||
rcu_read_lock();
|
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
|
* allocations are extremely rare but can happen, for instance, for the
|
||||||
* cache arrays. We bring this test here.
|
* cache arrays. We bring this test here.
|
||||||
*/
|
*/
|
||||||
if (!current->mm || current->memcg_kmem_skip_account)
|
if (current->memcg_kmem_skip_account)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
memcg = get_mem_cgroup_from_mm(current->mm);
|
memcg = get_mem_cgroup_from_mm(current->mm);
|
||||||
|
|
Loading…
Reference in a new issue