Re: [PATCH v5 08/12] rust: mm: add abstractions for allocating from a `sheaf`
From: Vlastimil Babka (SUSE)
Date: Thu Sep 03 2026 - 06:13:24 EST
On 9/2/26 15:26, Andreas Hindborg wrote:
> Add Rust APIs for allocating objects from a `sheaf`.
>
> Introduce a reduced abstraction `KMemCacheInit` for `struct kmem_cache` to
> support management of the `Sheaf`s.
>
> Initialize objects using in-place initialization when objects are allocated
> from a `Sheaf`. This is different from C which tends to do some
> initialization when the cache is filled. This approach is chosen because
> there is no destructor/drop capability in `struct kmem_cache` that can be
> invoked when the cache is dropped.
>
> Cc: Vlastimil Babka <vbabka@xxxxxxx>
> Cc: "Liam R. Howlett" <Liam.Howlett@xxxxxxxxxx>
> Cc: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx>
> Cc: Lorenzo Stoakes <lorenzo.stoakes@xxxxxxxxxx>
> Cc: linux-mm@xxxxxxxxx
> Assisted-by: LLM
> Signed-off-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
Acked-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
Note that currently all caches have sheaves (except CONFIG_SLUB_TINY or
slab_debug enabled), and sheaf_capacity on creation is treated as a minimum,
which the automated sizing calculation can make larger - in case you want to
reflect this detail in some of the description comments.