Re: [PATCH RFC 7/8] mm, slab: add slab_tiny boot param
From: Vlastimil Babka (SUSE)
Date: Thu Sep 24 2026 - 03:30:50 EST
On 9/23/26 17:45, Vlastimil Babka (SUSE) wrote:
> 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) <vbabka@xxxxxxxxxx>
> ---
> 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);
^ slab_tiny_enabled
missed a place on a last-minute rename.
The version in git is fixed:
https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/linux.git/log/?h=b4/slub_tiny_rework
> +}
> +
> +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)
>