On Thu, Jul 31, 2025 at 5:49 PM Danilo Krummrich <d...@kernel.org> wrote: > > aligned_size() dates back to when Rust did support kmalloc() only, but > is now used in ReallocFunc::call() and hence for all allocators. > > However, the additional padding applied by aligned_size() is only > required by the kmalloc() allocator backend. > > Hence, replace aligned_size() with Kmalloc::aligned_layout() and use it > for the affected allocators, i.e. kmalloc() and kvmalloc(), only. > > While at it, make Kmalloc::aligned_layout() public, such that Rust > abstractions, which have to call subsystem specific kmalloc() based > allocation primitives directly, can make use of it. > > Fixes: 8a799831fc63 ("rust: alloc: implement `ReallocFunc`") > Signed-off-by: Danilo Krummrich <d...@kernel.org>
Did this need Cc: stable or was it skipped since it is just extra padding? (i.e. not sure what you usually do for DRM, but I was looking at this since it is alloc since I would normally pick it.) Thanks! Cheers, Miguel