From: Alice Ryhl <aliceryhl@google.com>
To: Danilo Krummrich <dakr@kernel.org>
Cc: lorenzo.stoakes@oracle.com, vbabka@suse.cz,
Liam.Howlett@oracle.com, urezki@gmail.com, ojeda@kernel.org,
alex.gaynor@gmail.com, boqun.feng@gmail.com, gary@garyguo.net,
bjorn3_gh@protonmail.com, lossin@kernel.org,
a.hindborg@kernel.org, tmgross@umich.edu,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, simona@ffwll.ch,
rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] rust: alloc: replace aligned_size() with Kmalloc::aligned_layout()
Date: Fri, 1 Aug 2025 09:14:53 +0000 [thread overview]
Message-ID: <aIyFjU67jPkK1BUt@google.com> (raw)
In-Reply-To: <20250731154919.4132-2-dakr@kernel.org>
On Thu, Jul 31, 2025 at 05:48:06PM +0200, Danilo Krummrich 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 <dakr@kernel.org>
I guess vmalloc handles alignment in a different way ... ok makes sense
to me.
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
next prev parent reply other threads:[~2025-08-01 9:14 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-31 15:48 [PATCH 0/4] Alloc and drm::Device fixes Danilo Krummrich
2025-07-31 15:48 ` [PATCH 1/4] rust: alloc: replace aligned_size() with Kmalloc::aligned_layout() Danilo Krummrich
2025-08-01 9:14 ` Alice Ryhl [this message]
2025-08-12 19:52 ` Miguel Ojeda
2025-08-12 20:00 ` Danilo Krummrich
2025-08-12 20:12 ` Miguel Ojeda
2025-08-12 20:35 ` Danilo Krummrich
2025-08-16 20:40 ` Miguel Ojeda
2025-08-16 23:44 ` Danilo Krummrich
2025-07-31 15:48 ` [PATCH 2/4] rust: drm: ensure kmalloc() compatible Layout Danilo Krummrich
2025-08-01 9:18 ` Alice Ryhl
2025-08-01 9:29 ` Danilo Krummrich
2025-08-04 13:44 ` Alice Ryhl
2025-08-04 14:00 ` Alice Ryhl
2025-07-31 15:48 ` [PATCH 3/4] rust: drm: remove pin annotations from drm::Device Danilo Krummrich
2025-07-31 18:54 ` Benno Lossin
2025-08-01 8:21 ` Danilo Krummrich
2025-08-01 9:00 ` Benno Lossin
2025-08-01 9:52 ` Benno Lossin
2025-07-31 15:48 ` [PATCH 4/4] rust: drm: don't pass the address of drm::Device to drm_dev_put() Danilo Krummrich
2025-08-01 9:13 ` Alice Ryhl
2025-08-11 21:41 ` [PATCH 0/4] Alloc and drm::Device fixes Danilo Krummrich
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=aIyFjU67jPkK1BUt@google.com \
--to=aliceryhl@google.com \
--cc=Liam.Howlett@oracle.com \
--cc=a.hindborg@kernel.org \
--cc=airlied@gmail.com \
--cc=alex.gaynor@gmail.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=lossin@kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=simona@ffwll.ch \
--cc=tmgross@umich.edu \
--cc=tzimmermann@suse.de \
--cc=urezki@gmail.com \
--cc=vbabka@suse.cz \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.