Re: [PATCH v6 4/6] mm/slab: Introduce kmem_buckets_create() and family

From: Kees Cook
Date: Tue Jul 02 2024 - 16:12:01 EST


On Tue, Jul 02, 2024 at 11:19:28AM +0200, Vlastimil Babka wrote:
> On 7/1/24 9:13 PM, Kees Cook wrote:
> > #ifdef SLAB_SUPPORTS_SYSFS
> > /*
> > * For a given kmem_cache, kmem_cache_destroy() should only be called
> > @@ -931,6 +1023,10 @@ void __init create_kmalloc_caches(void)
> >
> > /* Kmalloc array is now usable */
> > slab_state = UP;
> > +
> > + kmem_buckets_cache = kmem_cache_create("kmalloc_buckets",
> > + sizeof(kmem_buckets),
> > + 0, SLAB_NO_MERGE, NULL);
>
> Locally adjusted to put this behind "if (IS_ENABLED(CONFIG_SLAB_BUCKETS))"

Oops, yes, good catch. Thank you!

--
Kees Cook