In order to deprecate the CONFIG_SLUB_TINY option, introduce an early boot param slab_tiny to control the value of slab_tiny_enabled. As long as CONFIG_SLUB_TINY is still around and enabled, this boot param can also override it to be disabled. Signed-off-by: Vlastimil Babka (SUSE) --- Documentation/admin-guide/kernel-parameters.txt | 4 ++++ Documentation/admin-guide/mm/slab.rst | 5 +++++ mm/slub.c | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 33cd30996e47..0100ab00388a 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -7031,6 +7031,10 @@ Kernel parameters NUMA kernel object placement which helps with slow interconnects in NUMA systems. + slab_tiny= [MM, EARLY] + Minimize the slab allocator memory footprint at the + expense of SMP scalability. + slram= [HW,MTD] smart2= [HW] diff --git a/Documentation/admin-guide/mm/slab.rst b/Documentation/admin-guide/mm/slab.rst index 0beeae71d472..6c005d3de0b2 100644 --- a/Documentation/admin-guide/mm/slab.rst +++ b/Documentation/admin-guide/mm/slab.rst @@ -94,6 +94,11 @@ kdump kernels where scalability is not a concern, but memory has to be slab_debug=N +Note that for this purpose you can instead use an option that can achieve +slightly better memory savings (by not creating separate kmalloc-rcl caches):: + + slab_tiny=1 + You can apply different options to different list of slab names, using blocks of options. This will enable red zoning for dentry and user tracking for kmalloc. All other slabs will not get any debugging enabled:: diff --git a/mm/slub.c b/mm/slub.c index 4814f025fde5..d672809fa2f6 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -8726,6 +8726,13 @@ void __init kmem_cache_init_late(void) #endif } +static int __init early_slab_tiny(char *buf) +{ + return kstrtobool(buf, &slub_tiny_enabled); +} + +early_param("slab_tiny", early_slab_tiny); + int do_kmem_cache_create(struct kmem_cache *s, const char *name, unsigned int size, struct kmem_cache_args *args, slab_flags_t flags) -- 2.55.0