[PATCH v8 0/2] Rust allocator and kvec improvements
From: Hui Zhu
Date: Thu Jul 31 2025 - 04:44:58 EST
From: Hui Zhu <zhuhui@xxxxxxxxxx>
This series adds tests and docs for Rust kernel components:
Patch 1 adds KUnit tests for allocator alignment guarantees.
and simplifies KVec test module naming convention.
Patch 2 documents KVec::as_slice with a usage example.
Both patches are co-developed with Geliang Tang. Based on [1].
Tested on x86_64 using KUnit.
Changelog:
v8:
Updated according to the comments of David.
v7:
Updated according to the comments of Miguel.
v6:
According to the comments of Danilo, updated test for allocator.rs
and allocator rebase onto [1].
v5:
According to the comments of Danilo, change to use generic struct and
allocator Generics in allocator.rs.
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.
[1] https://lore.kernel.org/lkml/20250715135645.2230065-1-vitaly.wool@xxxxxxxxxxx/
Hui Zhu (2):
rust: alloc: add alignment tests for allocators
rust: alloc: kvec: add doc example for as_slice method
rust/kernel/alloc/allocator.rs | 56 ++++++++++++++++++++++++++++++++++
rust/kernel/alloc/kvec.rs | 12 +++++++-
2 files changed, 67 insertions(+), 1 deletion(-)
--
2.43.0