Re: [PATCH v3 03/10] mm, slab: refactor slab_min/max_order handling

From: Harry Yoo

Date: Thu Nov 05 2026 - 08:29:35 EST


On Thu, Nov 05, 2026 at 09:43:52AM +0100, Vlastimil Babka (SUSE) wrote:
> Setting slab_min_order and slab_max_order as boot-time parameters
> currently has several not so great aspects:
>
> - slab_min_order is not checked against MAX_PAGE_ORDER
> - slab_min_order can raise slab_max_order
> - processing requires custom callbacks, their execution order
> depends on the order of boot time parameters specified
> - upcoming SLUB_TINY changes would be more complicated
>
> Instead of custom callbacks, introduce __initdata variables that hold
> the boot-time parameter values (if given). All inputs are then evaluated
> deterministically in kmem_cache_init(). slab_min_order is always capped
> at slab_max_order and cannot raise it.
>
> debug_guardpage_minorder() still overrides any given boot time params,
> but it could be changed if there's a use case.
>
> While at it, rename the slub_min/max_order variables and
> slub_min_objects to have a "slab_" prefix instead, as their values
> determine the sizing of slabs, and the "slub_" prefix already became
> deprecated also for the boot-time parameters.
>
> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---

Looks good to me,
Reviewed-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>

--
Cheers,
Harry / Hyeonggon