summaryrefslogtreecommitdiff
path: root/mm/slub.c
diff options
context:
space:
mode:
authorRoman Gushchin <guro@fb.com>2020-08-07 09:21:20 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-07 21:33:25 +0300
commitc7094406fcb7cdf4fe1de8893f0613b75349773d (patch)
tree17ae29ac1e0c8374227bb23e44be0ee5084e6052 /mm/slub.c
parent272911a4ad18c48f8bc449a5db945a54987dd687 (diff)
downloadlinux-c7094406fcb7cdf4fe1de8893f0613b75349773d.tar.xz
mm: memcg/slab: deprecate slab_root_caches
Currently there are two lists of kmem_caches: 1) slab_caches, which contains all kmem_caches, 2) slab_root_caches, which contains only root kmem_caches. And there is some preprocessor magic to have a single list if CONFIG_MEMCG_KMEM isn't enabled. It was required earlier because the number of non-root kmem_caches was proportional to the number of memory cgroups and could reach really big values. Now, when it cannot exceed the number of root kmem_caches, there is really no reason to maintain two lists. We never iterate over the slab_root_caches list on any hot paths, so it's perfectly fine to iterate over slab_caches and filter out non-root kmem_caches. It allows to remove a lot of config-dependent code and two pointers from the kmem_cache structure. 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-16-guro@fb.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r--mm/slub.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 44a48a08a691..9cd724fe37d8 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4360,7 +4360,6 @@ static struct kmem_cache * __init bootstrap(struct kmem_cache *static_cache)
}
slab_init_memcg_params(s);
list_add(&s->list, &slab_caches);
- memcg_link_cache(s);
return s;
}