Subject: Re: linux-next: manual merge of the rust-alloc tree with the mm-unstable tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 8 Sep 2025 17:55:57 +1000

Hi all,

On Mon, 18 Aug 2025 12:20:53 +1000 Stephen Rothwell <[email-masked]> wrote:
>
> Today's linux-next merge of the rust-alloc tree got a conflict in:
> 
>   rust/kernel/alloc.rs
> 
> between commit:
> 
>   defab7872312 ("rust: add support for NUMA ids in allocations")
> 
> from the mm-unstable tree and commit:
> 
>   1b1a946dc2b5 ("rust: alloc: specify the minimum alignment of each allocator")
> 
> from the rust-alloc tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> 
> 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`).

This is now a conflict between the rust tree and the mm-unstable tree.

-- 
Cheers,
Stephen Rothwell