rust/kernel/alloc/allocator.rs | 56 ++++++++++++++++++++++++++++++++++ rust/kernel/alloc/kvec.rs | 12 +++++++- 2 files changed, 67 insertions(+), 1 deletion(-)
From: Hui Zhu <zhuhui@kylinos.cn> This series adds tests and docs for Rust kernel components: Patch 1 adds KUnit tests for allocator alignment guarantees. Patch 2 documents KVec::as_slice with a usage example. Patch 3 simplifies KVec test module naming convention. Both patches are co-developed with Geliang Tang. Based on [1]. Tested on x86_64 using KUnit. Changelog: 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. Hui Zhu (3): rust: allocator: add KUnit tests for alignment guarantees rust: alloc: kvec: add doc example for as_slice method rust: alloc: kvec: simplify KUnit test module name to "rust_kvec" rust/kernel/alloc/allocator.rs | 56 ++++++++++++++++++++++++++++++++++ rust/kernel/alloc/kvec.rs | 12 +++++++- 2 files changed, 67 insertions(+), 1 deletion(-) -- 2.43.0
On 7/31/25 4:50 AM, Hui Zhu wrote: > rust: alloc: kvec: add doc example for as_slice method > rust: alloc: kvec: simplify KUnit test module name to "rust_kvec" Applied to alloc-next, thanks!
On Thu, 31 Jul 2025 at 10:51, Hui Zhu <hui.zhu@linux.dev> wrote: > > From: Hui Zhu <zhuhui@kylinos.cn> > > This series adds tests and docs for Rust kernel components: > Patch 1 adds KUnit tests for allocator alignment guarantees. > Patch 2 documents KVec::as_slice with a usage example. > Patch 3 simplifies KVec test module naming convention. > > Both patches are co-developed with Geliang Tang. Based on [1]. > Tested on x86_64 using KUnit. > This series looks good to me from a KUnit perspective. I've also tested it out across a bunch of architectures (UML, x86_64, arm, arm64) with no problems. A few minor notes: - You should squash patch 3 into patch 1: there's no need to introduce the test with one name only to rename it in a later patch. - The link to [1] is missing in this cover letter. (But at least the test fails nicely without it!) Otherwise, looks good! The whole series is: Reviewed-by: David Gow <davidgow@google.com> Cheers, -- David > Changelog: > 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. > > Hui Zhu (3): > rust: allocator: add KUnit tests for alignment guarantees > rust: alloc: kvec: add doc example for as_slice method > rust: alloc: kvec: simplify KUnit test module name to "rust_kvec" > > rust/kernel/alloc/allocator.rs | 56 ++++++++++++++++++++++++++++++++++ > rust/kernel/alloc/kvec.rs | 12 +++++++- > 2 files changed, 67 insertions(+), 1 deletion(-) > > -- > 2.43.0 > >
On Thu Jul 31, 2025 at 6:14 AM CEST, David Gow wrote: > On Thu, 31 Jul 2025 at 10:51, Hui Zhu <hui.zhu@linux.dev> wrote: >> >> From: Hui Zhu <zhuhui@kylinos.cn> >> >> This series adds tests and docs for Rust kernel components: >> Patch 1 adds KUnit tests for allocator alignment guarantees. >> Patch 2 documents KVec::as_slice with a usage example. >> Patch 3 simplifies KVec test module naming convention. >> >> Both patches are co-developed with Geliang Tang. Based on [1]. >> Tested on x86_64 using KUnit. >> > > This series looks good to me from a KUnit perspective. I've also > tested it out across a bunch of architectures (UML, x86_64, arm, > arm64) with no problems. > > A few minor notes: > - You should squash patch 3 into patch 1: there's no need to introduce > the test with one name only to rename it in a later patch. The test introduced in patch 1 is not the one renamed in patch 3. :)
© 2016 - 2025 Red Hat, Inc.