Re: [RFC PATCH 01/15] static kmem_cache instances for core caches
From: Al Viro
Date: Wed Jan 14 2026 - 02:37:16 EST
On Wed, Jan 14, 2026 at 04:30:24PM +0900, Harry Yoo wrote:
> SLAB_NO_MERGE prevents both side of merging - when 1) creating the cache,
> and when 2) another cache tries to create an alias from it.
>
> Avoiding 1) makes sense, but is there a reason to prevent 2)?
>
> If it's fine for other caches to merge into a cache with static
> duration, then it's sufficient to update find_mergeable() to not attempt
> creating an alias during cache creation if args->preallocated is
> specified (instead of using SLAB_NO_MERGE).
Umm... For static-in-module - definitely (what if it goes away before
the dynamic alias?), for globally static... might be fine, I guess...