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
It allows to remove a lot of config-dependent code and two pointers from
the kmem_cache structure.
Signed-off-by: Roman Gushchin <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
Reviewed-by: Vlastimil Babka <firstname.lastname@example.org>
Reviewed-by: Shakeel Butt <email@example.com>
Cc: Christoph Lameter <firstname.lastname@example.org>
Cc: Johannes Weiner <email@example.com>
Cc: Michal Hocko <firstname.lastname@example.org>
Cc: Tejun Heo <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
4 files changed