mm, slub: remove percpu slabs with CONFIG_SLUB_TINY
authorVlastimil Babka <vbabka@suse.cz>
Tue, 15 Nov 2022 17:14:31 +0000 (18:14 +0100)
committerVlastimil Babka <vbabka@suse.cz>
Wed, 30 Nov 2022 23:09:09 +0000 (00:09 +0100)
commit0af8489b0216fa1dd83e264bef8063f2632633d7
tree704e42a5423c994b0e8c179c9e5cf9da191e0386
parent56d5a2b9ba85a390473e86b4fe4697560242a248
mm, slub: remove percpu slabs with CONFIG_SLUB_TINY

SLUB gets most of its scalability by percpu slabs. However for
CONFIG_SLUB_TINY the goal is minimal memory overhead, not scalability.
Thus, #ifdef out the whole kmem_cache_cpu percpu structure and
associated code. Additionally to the slab page savings, this reduces
percpu allocator usage, and code size.

This change builds on recent commit c7323a5ad078 ("mm/slub: restrict
sysfs validation to debug caches and make it safe"), as caches with
enabled debugging also avoid percpu slabs and all allocations and
freeing ends up working with the partial list. With a bit more
refactoring by the preceding patches, use the same code paths with
CONFIG_SLUB_TINY.

Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Mike Rapoport <rppt@linux.ibm.com>
Reviewed-by: Christoph Lameter <cl@linux.com>
include/linux/slub_def.h
mm/slub.c