Re: [PATCH RFC 0/8] replace CONFIG_SLUB_TINY with a slab_tiny boot parameter

From: Vlastimil Babka (SUSE)

Date: Fri Oct 23 2026 - 04:21:06 EST


On 9/24/26 17:18, Harry Yoo wrote:
> On Wed, Sep 23, 2026 at 05:45:05PM +0200, Vlastimil Babka (SUSE) wrote:
>> To sum up, after this series:
>>
>> - CONFIG_SLUB_TINY is a deprecated option that has no interaction with
>> other options and only controls the default behavior.
>>
>> - New slab_tiny boot parameter controls the functionality (and can
>> override CONFIG_SLUB_TINY in both directions).
>>
>> - slab_debug=N can effectively achieve most of slab_tiny and on a
>> per-cache basic
>
> Allowing "slab_tiny=0" doesn't make much sense given that
> CONFIG_SLUB_TINY is deprecated anyway. I was assuming specifying
> "slab_tiny" would enable it and not specifying it would disable it
> unless CONFIG_SLUB_TINY is set.

I was anticipating a possible autodetection in the future - i.e. "is this
system so tiny we should do it?" and a way to override to =0 may be useful.

> Also it's bit confusing to have multiple ways to achieve the same thing.
> Is there a reason why we can't interpret "slab_debug=N" as
> "slab_tiny_enabled = 1" internally and drop "slab_tiny" boot parameter?

"slab_debug=N" is a weird parameter to control the whole slab_tiny (which
does more than the slab_debug part). In my view it exists as a side-effect
to how slab_tiny is implemented. But because slab_tiny is implemented using
that, I thought it might make sense to expose slab_debug=N separately too.
It might be even useful in some debug scenario.

Whoever wants to use slab_tiny doesn't even need to know about slab_debug.

>> - the implementation is simpler with many ifdefs removed
>>
>> [1] https://lore.kernel.org/all/CAHk-=wh-k04MsoEC0SGKff2Snm6bBF_e+0pHOKwaWv4umZ_SnQ@xxxxxxxxxxxxxx/
>>
>> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
>> ---
>> Vlastimil Babka (SUSE) (8):
>> mm, slab: refactor slab_min/max_order handling
>> mm, slab: introduce slab_debug=N
>> mm, slab: rework KMALLOC_RECLAIM handling of SLUB_TINY
>> mm, slab: make SLUB_TINY handling dynamic for sizing decisions
>> mm, slab: convert CONFIG_SLUB_TINY checks to kmem_cache_debug()
>> mm, slab: remove remaining compile-time checks for CONFIG_SLUB_TINY
>> mm, slab: add slab_tiny boot param
>> mm, slab: deprecate CONFIG_SLUB_TINY and reduce its Kconfig effects
>>
>> Documentation/admin-guide/kernel-parameters.txt | 4 +
>> Documentation/admin-guide/mm/slab.rst | 18 ++-
>> include/linux/slab.h | 17 +--
>> lib/Kconfig.kasan | 2 +-
>> mm/Kconfig | 16 ++-
>> mm/Kconfig.debug | 2 +-
>> mm/slab.h | 32 +++--
>> mm/slab_common.c | 12 +-
>> mm/slub.c | 149 +++++++++++-------------
>> 9 files changed, 120 insertions(+), 132 deletions(-)
>> ---
>> base-commit: b4218126d498275444f315b0ed4cef6add6beabc
>> change-id: 20260911-slub_tiny_rework-8f2634dd17a7
>>
>