[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1752573305.git.zhuhui@kylinos.cn>
Date: Tue, 15 Jul 2025 17:59:45 +0800
From: Hui Zhu <hui.zhu@...ux.dev>
To: Andrew Morton <akpm@...ux-foundation.org>,
Uladzislau Rezki <urezki@...il.com>,
Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
bjorn3_gh@...tonmail.com,
Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>,
Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>,
Geliang Tang <geliang@...nel.org>,
Hui Zhu <zhuhui@...inos.cn>,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
rust-for-linux@...r.kernel.org
Subject: [PATCH 0/3] rust: allocator: Vmalloc: Support alignments larger than PAGE_SIZE
From: Hui Zhu <zhuhui@...inos.cn>
There is a TODO in Vmalloc::realloc "Support alignments larger than
PAGE_SIZE."
These commits make allocator vmalloc support alignments larger than
PAGE_SIZE.
The function vrealloc_align is added to vmalloc.c to support reallocating
aligned vmap pages.
When Vmalloc::realloc intends to reallocate memory aligned beyond PAGE_SIZE,
vrealloc_align should be used instead of vrealloc, thus enabling support
for alignments larger than PAGE_SIZE.
And add a sample to the samples memory allocator usage.
Hui Zhu (3):
vmalloc: Add vrealloc_align to support allocation of aligned vmap
pages
rust: allocator: Vmalloc: Support alignments larger than PAGE_SIZE
rust: add a sample allocator usage
include/linux/vmalloc.h | 5 ++
mm/vmalloc.c | 80 ++++++++++++++++---------
rust/helpers/vmalloc.c | 7 +++
rust/kernel/alloc/allocator.rs | 32 ++++++----
samples/rust/Kconfig | 10 ++++
samples/rust/Makefile | 1 +
samples/rust/rust_allocator.rs | 104 +++++++++++++++++++++++++++++++++
7 files changed, 199 insertions(+), 40 deletions(-)
create mode 100644 samples/rust/rust_allocator.rs
--
2.43.0
Powered by blists - more mailing lists