rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@kernel.org>
To: Vitaly Wool <vitaly.wool@konsulko.se>
Cc: linux-mm@kvack.org, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, Uladzislau Rezki <urezki@gmail.com>,
	Alice Ryhl <aliceryhl@google.com>,
	rust-for-linux@vger.kernel.org
Subject: Re: [PATCH v6 4/4] rust: support large alignments in allocations
Date: Fri, 27 Jun 2025 20:37:18 +0200	[thread overview]
Message-ID: <aF7k3grxI2Y80sFo@pollux> (raw)
In-Reply-To: <20250627181650.2081123-1-vitaly.wool@konsulko.se>

On Fri, Jun 27, 2025 at 08:16:50PM +0200, Vitaly Wool wrote:
> 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.
> 
> Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.se>
> ---
>  rust/helpers/slab.c            | 14 ++++++++++++++
>  rust/helpers/vmalloc.c         |  7 +++++++
>  rust/kernel/alloc/allocator.rs | 34 +++++++++++-----------------------
>  3 files changed, 32 insertions(+), 23 deletions(-)
> 
> diff --git a/rust/helpers/slab.c b/rust/helpers/slab.c
> index 5abd552ccbd4..c4bb451bcf4e 100644
> --- a/rust/helpers/slab.c
> +++ b/rust/helpers/slab.c
> @@ -25,3 +25,17 @@ rust_helper_kvrealloc_node(const void *p, size_t size, gfp_t flags, int node)
>  {
>  	return kvrealloc_node(p, size, flags, node);
>  }
> +
> +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_kvrealloc_node_align(const void *p, size_t size, unsigned long align,
> +				gfp_t flags, int node)
> +{
> +	return kvrealloc_node_align(p, size, align, flags, node);
> +}
> diff --git a/rust/helpers/vmalloc.c b/rust/helpers/vmalloc.c
> index e6c796c65ee1..09aee472340f 100644
> --- a/rust/helpers/vmalloc.c
> +++ b/rust/helpers/vmalloc.c
> @@ -13,3 +13,10 @@ rust_helper_vrealloc_node(const void *p, size_t size, gfp_t flags, int node)
>  {
>  	return vrealloc_node(p, size, flags, node);
>  }
> +
> +void * __must_check __realloc_size(2)
> +rust_helper_vrealloc_node_align(const void *p, size_t size, unsigned long align,
> +				gfp_t flags, int node)
> +{
> +	return vrealloc_node_align(p, size, align, flags, node);
> +}

Here and in the previous patch, please remove unused helper functions when you
replace their usage with new ones.

Thanks,
Danilo

      reply	other threads:[~2025-06-27 18:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 18:15 [PATCH v5 0/4] support large align and nid in Rust allocators Vitaly Wool
2025-06-27 18:16 ` [PATCH v6 1/4] mm/vmalloc: allow to set node and align in vrealloc Vitaly Wool
2025-06-27 18:16 ` [PATCH v6 2/4] mm/slab: allow to set node and align in k[v]realloc Vitaly Wool
2025-06-27 18:16 ` [PATCH v6 3/4] rust: add support for NUMA ids in allocations Vitaly Wool
2025-06-27 18:36   ` Danilo Krummrich
2025-06-27 19:42     ` Vitaly Wool
2025-06-27 18:16 ` [PATCH v6 4/4] rust: support large alignments " Vitaly Wool
2025-06-27 18:37   ` Danilo Krummrich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aF7k3grxI2Y80sFo@pollux \
    --to=dakr@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=aliceryhl@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=urezki@gmail.com \
    --cc=vitaly.wool@konsulko.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).