lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DD22YQ6BWOVR.3NCRQJHLL63DO@kernel.org>
Date: Thu, 25 Sep 2025 20:08:13 +0200
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Liam R. Howlett" <Liam.Howlett@...cle.com>
Cc: "Elijah" <me@...jahs.space>, "Elijah Wright" <git@...jahs.space>,
 "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>, "Vlastimil Babka" <vbabka@...e.cz>,
 "Uladzislau Rezki" <urezki@...il.com>, <linux-mm@...ck.org>
Subject: Re: [PATCH] rust: slab: add basic slab module

On Thu Sep 25, 2025 at 8:02 PM CEST, Liam R. Howlett wrote:
> * Danilo Krummrich <dakr@...nel.org> [250925 13:43]:
>> On Thu Sep 25, 2025 at 7:20 PM CEST, Elijah wrote:
>> 
>
> ...
>
>> 
>> > I was thinking of maybe creating something like KBox for kmem_cache but 
>> > I didn't want to touch allocator code yet, I figured I would just create 
>> > the groundwork for that to exist. rbtree.rs uses KBox now but I'm not 
>> > sure it should, at least if it's going to scale to many nodes
>> 
>> Ok, so you want to support kmemcache for rbtree nodes. Ideally, you should also
>> have a use-case for that, but given that we'll also need kmemcache in other
>> drivers (such as Nova) anyways, I think that's fine.
>
> This seems different than what exists on the C side, at least to me.
> The rbtree is implemented by embedding the links to the prev/next into
> the struct which is using the tree.
>
> The above sounds like the nodes of the rbtree are allocated on its own
> and not part of another allocation on the rust side?
>
> That is, the kmemcache would allocate the struct that contains the
> rbtree linkage (or nodes, I guess), but not the nodes alone.

On the Rust side the rbtree's Node structure looks like this:

	struct Node<K, V> {
	    links: bindings::rb_node,
	    key: K,
	    value: V,
	}

The allocation would be for the entire rbtree::Node and not only for the C
struct rb_node.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ