diff mbox series

[04/40] mm: kmem: remove redundant checks from get_obj_cgroup_from_current()

Message ID 20201017231347.o9xpcQkwN%akpm@linux-foundation.org (mailing list archive)
State New, archived
Headers show
Series [01/40] ia64: fix build error with !COREDUMP | expand

Commit Message

Andrew Morton Oct. 17, 2020, 11:13 p.m. UTC
From: Roman Gushchin <guro@fb.com>
Subject: 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.

Link: http://lkml.kernel.org/r/20200827225843.1270629-3-guro@fb.com
Signed-off-by: Roman Gushchin <guro@fb.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/memcontrol.c |    3 ---
 1 file changed, 3 deletions(-)
diff mbox series

Patch

--- a/mm/memcontrol.c~mm-kmem-remove-redundant-checks-from-get_obj_cgroup_from_current
+++ a/mm/memcontrol.c
@@ -2939,9 +2939,6 @@  __always_inline struct obj_cgroup *get_o
 	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);