Re: [PATCH] rust: slab: add basic slab module

Danilo Krummrich
2025-09-25T18:15:29Z

On Thu Sep 25, 2025 at 8:05 PM CEST, Elijah wrote:
> On 9/25/2025 10:43 AM, Danilo Krummrich wrote:
>
> > Anyways, I'd also like to hear some more opinions, especially
> regarding (4), as
> > mentioned.
>
> ok I just looked it over. I think (4) isn't really viable, the cache
> pointer storage overhead is probably too much (in addition to some
> complex issues).

Probably, given that kmemcache is meant to be used when we have a lot of (small)
allocations.

However, I'd like to hear from the MM folks, if there may be options in the
existing infrastructure, or if it's really a dead end.

What are the other complex issues you are referring to?

> I don't really like having a macro (so (3) basically)
> and I think there are issues with non-static caches, I don't know
> specifically though. obviously (1) doesn't work. (2) is exactly what I
> was thinking specifically for rbtree. IMO the only useful options are
> (2) and (3). I would say maybe implement (2) first and if you want
> macro-generated ZST allocators they can wrap whatever that Box ends up
> being.

I'm not sold on duplicating the Box code just yet. What issues are you referring
to?