[PATCH RFC v2 7/8] mm, slab: add slab_tiny boot param
From: Vlastimil Babka (SUSE)
Date: Sat Oct 24 2026 - 15:09:04 EST
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. That could be also useful if we
later add some auto-enabling conditions such as detecting the system has
only a small amount of memory, or being a kdump kernel.
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 03636d799837..29dc1c812473 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -7043,6 +7043,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..350384908631 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 3b1491de5be7..3b7ba4fdeada 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -8829,6 +8829,13 @@ void __init kmem_cache_init_late(void)
#endif
}
+static int __init early_slab_tiny(char *buf)
+{
+ return kstrtobool(buf, &slab_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.56.0