Re: [PATCH v3 06/10] mm, slab: make SLUB_TINY handling dynamic for sizing decisions
From: Harry Yoo
Date: Sun Nov 08 2026 - 12:58:18 EST
On Thu, Nov 05, 2026 at 09:43:55AM +0100, Vlastimil Babka (SUSE) wrote:
> Enabling CONFIG_SLUB_TINY results in the caches' min partial slabs
> threshold to be zero, thus every slab where all objects become free is
> freed immediately. It also sets the default slab_max_order to 1, with
> the goal of reducing the potential of internal slab fragmentation.
>
> Rework both of these decisions to be based on the newly introduced
> slab_tiny_enabled flag instead of #ifdefs. It's still possible to
> override the reduced slab_max_order with the boot parameter, as before.
>
> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---
>
> mm/slub.c | 15 +++++++--------
> 1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/mm/slub.c b/mm/slub.c
> index a3ee1bdf0eb3..be4e1f193295 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -8027,7 +8021,7 @@ static unsigned int calculate_sheaf_capacity(struct kmem_cache *s,
> size_t size;
>
>
> - if (IS_ENABLED(CONFIG_SLUB_TINY) || s->flags & SLAB_DEBUG_FLAGS)
> + if (slab_tiny_enabled || s->flags & SLAB_DEBUG_FLAGS)
> return 0;
nit: this change is not mentioned in the changelog
Otherwise looks good to me,
Reviewed-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
--
Cheers,
Harry / Hyeonggon