[PATCH v2 19/27] rust: slab: add __rust_helper to helpers

Alice Ryhl posted 27 patches 1 month ago
[PATCH v2 19/27] rust: slab: add __rust_helper to helpers
Posted by Alice Ryhl 1 month ago
This is needed to inline these helpers into Rust code.

Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
---
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@gentwo.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Vitaly Wool <vitaly.wool@konsulko.se>
Cc: Danilo Krummrich <dakr@kernel.org>
---
 rust/helpers/slab.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/rust/helpers/slab.c b/rust/helpers/slab.c
index 7fac958907b0a7cbb28ef3a8a56e0cc10d39288f..9279f082467d896381e34c4333492a92d626da2e 100644
--- a/rust/helpers/slab.c
+++ b/rust/helpers/slab.c
@@ -2,14 +2,14 @@
 
 #include <linux/slab.h>
 
-void * __must_check __realloc_size(2)
+__rust_helper void *__must_check __realloc_size(2)
 rust_helper_krealloc_node_align(const void *objp, size_t new_size, unsigned long align,
 				gfp_t flags, int node)
 {
 	return krealloc_node_align(objp, new_size, align, flags, node);
 }
 
-void * __must_check __realloc_size(2)
+__rust_helper void *__must_check __realloc_size(2)
 rust_helper_kvrealloc_node_align(const void *p, size_t size, unsigned long align,
 				 gfp_t flags, int node)
 {

-- 
2.52.0.351.gbe84eed79e-goog
Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
Posted by Danilo Krummrich 1 month ago
On Mon Jan 5, 2026 at 1:42 PM CET, Alice Ryhl wrote:
> This is needed to inline these helpers into Rust code.
>
> Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>

Since this file contains the helpers for the alloc module, I assume I should
take it through the alloc tree? Maybe we should also add it to the alloc entry
in maintainers.

Anyways, so far I do not have anything staged in the alloc tree for this cycle,
so it would probably be easier if either Andrew or Miguel picks it up directly.

Acked-by: Danilo Krummrich <dakr@kernel.org>
Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
Posted by Alice Ryhl 1 month ago
On Mon, Jan 05, 2026 at 01:56:05PM +0100, Danilo Krummrich wrote:
> On Mon Jan 5, 2026 at 1:42 PM CET, Alice Ryhl wrote:
> > This is needed to inline these helpers into Rust code.
> >
> > Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
> > Reviewed-by: Gary Guo <gary@garyguo.net>
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
> 
> Since this file contains the helpers for the alloc module, I assume I should
> take it through the alloc tree? Maybe we should also add it to the alloc entry
> in maintainers.
> 
> Anyways, so far I do not have anything staged in the alloc tree for this cycle,
> so it would probably be easier if either Andrew or Miguel picks it up directly.
> 
> Acked-by: Danilo Krummrich <dakr@kernel.org>

Sounds good to me. There is also mm and maple_tree for Andrew Morton.

Alice
Re: [PATCH v2 19/27] rust: slab: add __rust_helper to helpers
Posted by Miguel Ojeda 1 month ago
On Mon, Jan 5, 2026 at 2:06 PM Alice Ryhl <aliceryhl@google.com> wrote:
>
> Sounds good to me. There is also mm and maple_tree for Andrew Morton.

Either way sounds good for me -- anyway I will have to pick the `bug`
and `err` at least.

Cheers,
Miguel