[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DC38NDRET9NB.31UDI8FHB7WAY@kernel.org>
Date: Fri, 15 Aug 2025 21:12:12 +0200
From: "Danilo Krummrich" <dakr@...nel.org>
To: "Alice Ryhl" <aliceryhl@...gle.com>, "Andrew Morton"
<akpm@...ux-foundation.org>
Cc: "Lorenzo Stoakes" <lorenzo.stoakes@...cle.com>, "Liam R. Howlett"
<Liam.Howlett@...cle.com>, "Matthew Wilcox" <willy@...radead.org>, "Tamir
Duberstein" <tamird@...il.com>, "Andreas Hindborg" <a.hindborg@...nel.org>,
"Miguel Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun.feng@...il.com>,
"Gary Guo" <gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Benno Lossin" <lossin@...nel.org>, "Trevor
Gross" <tmgross@...ch.edu>, <linux-mm@...ck.org>,
<rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 0/2] Take ARCH_KMALLOC_MINALIGN into account for
build-time XArray check
On Mon Aug 11, 2025 at 2:31 PM CEST, Alice Ryhl wrote:
> Alice Ryhl (2):
> rust: alloc: specify the minimum alignment of each allocator
[ Add helper for ARCH_KMALLOC_MINALIGN; remove cast to usize. - Danilo ]
> rust: alloc: take the allocator into account for FOREIGN_ALIGN
Applied to alloc-next, thanks!
--
@Andrew: Just a heads-up, this has a minor conflict with your tree, which
should also show up in linux-next soon.
diff --cc rust/kernel/alloc.rs
index b39c279236f5,907301334d8c..000000000000
--- a/rust/kernel/alloc.rs
+++ b/rust/kernel/alloc.rs
@@@ -164,7 -137,15 +164,15 @@@ impl NumaNode
/// - Implementers must ensure that all trait functions abide by the guarantees documented in the
/// `# Guarantees` sections.
pub unsafe trait Allocator {
+ /// The minimum alignment satisfied by all allocations from this allocator.
+ ///
+ /// # Guarantees
+ ///
+ /// Any pointer allocated by this allocator is guaranteed to be aligned to `MIN_ALIGN` even if
+ /// the requested layout has a smaller alignment.
+ const MIN_ALIGN: usize;
+
- /// Allocate memory based on `layout` and `flags`.
+ /// Allocate memory based on `layout`, `flags` and `nid`.
///
/// On success, returns a buffer represented as `NonNull<[u8]>` that satisfies the layout
/// constraints (i.e. minimum size and alignment as specified by `layout`).
Powered by blists - more mailing lists