[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a6de773c-77f4-4f2b-b8fa-464493ca7c75@suse.cz>
Date: Mon, 29 Sep 2025 09:14:10 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Danilo Krummrich <dakr@...nel.org>, Elijah Wright <git@...jahs.space>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <lossin@...nel.org>, Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>, Trevor Gross <tmgross@...ch.edu>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Uladzislau Rezki <urezki@...il.com>, linux-mm@...ck.org
Subject: Re: [PATCH] rust: slab: add basic slab module
On 9/28/25 16:47, Danilo Krummrich wrote:
> On Thu Sep 25, 2025 at 11:54 AM CEST, Danilo Krummrich wrote:
>> (3) Implement a macro to generate a custom KmemCache Allocator trait
>> implementation for every KmemCache instance with a static lifetime.
>
> Thinking about it a bit more, I think we should go with option (3) for now.
>
> With its only limitation being that it always binds the lifetime of a kmemcache
> to the module lifetime, it still seems to be the best option, considering that
> the alternatives require additional synchronization in hot paths, may *silently*
> leak the kmemcache, cause significant code duplication or break dynamic
> dispatch.
>
> Tieing the kmemcache to the module lifetime should cover the vast majority of
> use-cases; should we ever really need something else we can still revisit the
> options.
Sounds good.
> Thanks,
> Danilo
Powered by blists - more mailing lists