From: Roman Gushchin Date: Sat, 17 Oct 2020 23:13:47 +0000 (-0700) Subject: mm: kmem: remove redundant checks from get_obj_cgroup_from_current() X-Git-Tag: v5.10.7~1381^2~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=67f0286498d7486a9c35f081df1dffe2ffcd02b9;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Andrew Morton Reviewed-by: Shakeel Butt Cc: Johannes Weiner Cc: Michal Hocko Link: http://lkml.kernel.org/r/20200827225843.1270629-3-guro@fb.com Signed-off-by: Linus Torvalds --- diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 197b9dd..51b1698 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -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);