Skip to content

Commit

Permalink
mm: kmem: remove redundant checks from get_obj_cgroup_from_current()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Reviewed-by: Shakeel Butt <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Michal Hocko <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
rgushchin authored and torvalds committed Oct 18, 2020
1 parent 279c339 commit 67f0286
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2939,9 +2939,6 @@ __always_inline struct obj_cgroup *get_obj_cgroup_from_current(void)
if (memcg_kmem_bypass())
return NULL;

if (unlikely(!current->mm && !current->active_memcg))
return NULL;

rcu_read_lock();
if (unlikely(current->active_memcg))
memcg = rcu_dereference(current->active_memcg);
Expand Down

0 comments on commit 67f0286

Please sign in to comment.