Message ID | 20200827175215.319780-3-guro@fb.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mm: kmem: kernel memory accounting in an interrupt context | expand |
On Thu, Aug 27, 2020 at 10:52 AM Roman Gushchin <guro@fb.com> wrote: > > 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> Reviewed-by: Shakeel Butt <shakeelb@google.com>
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 9c08d8d14bc0..5d847257a639 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2919,9 +2919,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);
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> --- mm/memcontrol.c | 3 --- 1 file changed, 3 deletions(-)