[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1753348867.git.zhuhui@kylinos.cn>
Date: Thu, 24 Jul 2025 17:25:33 +0800
From: Hui Zhu <hui.zhu@...ux.dev>
To: Danilo Krummrich <dakr@...nel.org>,
Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>,
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>,
rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Hui Zhu <zhuhui@...inos.cn>
Subject: [PATCH v4 0/2] rust: alloc: kvec doc example and allocator unit tests
From: Hui Zhu <zhuhui@...inos.cn>
This series includes two Rust patches:
Patch 1 adds KUnit tests for Rust allocation wrappers (kmalloc, vmalloc,
kvmalloc). It covers basic allocations, large alignments, and checks for
expected failures. Each test verifies content integrity through byte
pattern checks.
Patch 2 improves the documentation for KVec::as_slice() by adding a
code example. This shows how to use the method with push operations and
assertions.
Both patches are co-developed with Geliang Tang. Tested on x86_64 using
KUnit.
Changelog:
v4:
According to the comments of, add the error check for push.
v3:
According to the comments of Danilo and Boqun, move KVec test to doc
example and move VBox to allocator unit tests.
v2:
According to the comments of Danilo, updated the commit to samples the
usage of VBox and KVec.
Hui Zhu (2):
rust: allocator: add unit tests of kmalloc, vmalloc and kvmalloc
rust: alloc: kvec: add doc example for as_slice method
rust/kernel/alloc/allocator.rs | 57 ++++++++++++++++++++++++++++++++++
rust/kernel/alloc/kvec.rs | 10 ++++++
2 files changed, 67 insertions(+)
--
2.43.0
Powered by blists - more mailing lists