summaryrefslogtreecommitdiff
path: root/rust/helpers/slab.c
diff options
context:
space:
mode:
authorVitaly Wool <vitaly.wool@konsulko.se>2025-08-06 15:55:52 +0300
committerAndrew Morton <akpm@linux-foundation.org>2025-09-14 02:54:46 +0300
commit1738796994a439b0ea796847e3ceb8688dacd93d (patch)
tree933fff733da7d4072f1c3c760ea9a022296ebb8c /rust/helpers/slab.c
parent7760b6421b6c1b49550885ecdfa9cf720ead6eed (diff)
downloadlinux-1738796994a439b0ea796847e3ceb8688dacd93d.tar.xz
rust: support large alignments in allocations
Add support for large (> PAGE_SIZE) alignments in Rust allocators. All the preparations on the C side are already done, we just need to add bindings for <alloc>_node_align() functions and start using those. Link: https://lkml.kernel.org/r/20250806125552.1727073-1-vitaly.wool@konsulko.se Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.se> Acked-by: Danilo Krummrich <dakr@kernel.org> Acked-by: Alice Ryhl <aliceryhl@google.com> Cc: Herbert Xu <herbert@gondor.apana.org.au> Cc: Jann Horn <jannh@google.com> Cc: Kent Overstreet <kent.overstreet@linux.dev> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Uladzislau Rezki (Sony) <urezki@gmail.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'rust/helpers/slab.c')
-rw-r--r--rust/helpers/slab.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/rust/helpers/slab.c b/rust/helpers/slab.c
index 8472370a4338..7fac958907b0 100644
--- a/rust/helpers/slab.c
+++ b/rust/helpers/slab.c
@@ -3,13 +3,15 @@
#include <linux/slab.h>
void * __must_check __realloc_size(2)
-rust_helper_krealloc_node(const void *objp, size_t new_size, gfp_t flags, int node)
+rust_helper_krealloc_node_align(const void *objp, size_t new_size, unsigned long align,
+ gfp_t flags, int node)
{
- return krealloc_node(objp, new_size, flags, node);
+ return krealloc_node_align(objp, new_size, align, flags, node);
}
void * __must_check __realloc_size(2)
-rust_helper_kvrealloc_node(const void *p, size_t size, gfp_t flags, int node)
+rust_helper_kvrealloc_node_align(const void *p, size_t size, unsigned long align,
+ gfp_t flags, int node)
{
- return kvrealloc_node(p, size, flags, node);
+ return kvrealloc_node_align(p, size, align, flags, node);
}