summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorRoman Gushchin <guro@fb.com>2020-10-17 16:13:47 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-10-18 09:27:09 -0700
commit67f0286498d7486a9c35f081df1dffe2ffcd02b9 (patch)
tree0e0e0c32038e33a27215a2590c6cf9b07c8913eb /mm
parent279c3393e2c113365c999f16cd096bcf3d34319e (diff)
downloadlwn-67f0286498d7486a9c35f081df1dffe2ffcd02b9.tar.gz
lwn-67f0286498d7486a9c35f081df1dffe2ffcd02b9.zip
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 197b9ddb20f3..51b1698bf06c 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);