Skip to content

Commit

Permalink
mm: memcg/slab: remove redundant check in memcg_accumulate_slabinfo()
Browse files Browse the repository at this point in the history
memcg_accumulate_slabinfo() is never called with a non-root kmem_cache as
a first argument, so the is_root_cache(s) check is redundant and can be
removed without any functional change.

Signed-off-by: Roman Gushchin <guro@fb.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Christoph Lameter <cl@linux.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Link: http://lkml.kernel.org/r/20200623174037.3951353-17-guro@fb.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Roman Gushchin authored and Linus Torvalds committed Aug 7, 2020
1 parent c709440 commit 15999ee
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,9 +1104,6 @@ memcg_accumulate_slabinfo(struct kmem_cache *s, struct slabinfo *info)
struct kmem_cache *c;
struct slabinfo sinfo;

if (!is_root_cache(s))
return;

c = memcg_cache(s);
if (c) {
memset(&sinfo, 0, sizeof(sinfo));
Expand Down

0 comments on commit 15999ee

Please sign in to comment.