Skip to content

Commit 67f0286

Browse files
Roman Gushchintorvalds
authored andcommitted
mm: kmem: remove redundant checks from get_obj_cgroup_from_current()
There are checks for current->mm and current->active_memcg in get_obj_cgroup_from_current(), but these checks are redundant: memcg_kmem_bypass() called just above performs same checks. Signed-off-by: Roman Gushchin <guro@fb.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Shakeel Butt <shakeelb@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@kernel.org> Link: http://lkml.kernel.org/r/20200827225843.1270629-3-guro@fb.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 279c339 commit 67f0286

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

‎mm/memcontrol.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2939,9 +2939,6 @@ __always_inline struct obj_cgroup *get_obj_cgroup_from_current(void)
29392939
if (memcg_kmem_bypass())
29402940
return NULL;
29412941

2942-
if (unlikely(!current->mm && !current->active_memcg))
2943-
return NULL;
2944-
29452942
rcu_read_lock();
29462943
if (unlikely(current->active_memcg))
29472944
memcg = rcu_dereference(current->active_memcg);

0 commit comments

Comments
 (0)