提交 67f02864 编写于 作者: R Roman Gushchin 提交者: Linus Torvalds

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: NRoman Gushchin <guro@fb.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Reviewed-by: NShakeel 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.comSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 279c3393
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册