linux/rust/kernel/alloc
Shivam Kalra fbfc0d6153 rust: alloc: add KUnit tests for KVVec shrink_to
Add comprehensive KUnit tests for the shrink_to method for KVVec.
The tests verify:
- Basic shrinking from multiple pages to fewer pages with data integrity
  preservation
- Empty vector shrinking to zero capacity
- No-op behavior when shrinking to a larger capacity than current
- Respect for min_capacity parameter when larger than vector length
These tests ensure that the shrinking logic correctly identifies when
memory can be reclaimed (by freeing at least one page) and that data
integrity is maintained throughout shrink operations.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Signed-off-by: Shivam Kalra <shivamkalra98@zohomail.in>
Link: https://patch.msgid.link/20260216-binder-shrink-vec-v3-v6-2-ece8e8593e53@zohomail.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-02-26 21:37:53 -08:00
..
allocator rust: alloc: implement VmallocPageIter 2025-09-04 23:33:27 +02:00
kvec rust: alloc: use kernel::fmt 2025-10-20 04:04:23 +02:00
allocator.rs Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
kbox.rs Summary of significant series in this pull request: 2025-10-02 18:18:33 -07:00
kvec.rs rust: alloc: add KUnit tests for KVVec shrink_to 2026-02-26 21:37:53 -08:00
layout.rs drm next for 6.18-rc1 2025-10-02 12:47:25 -07:00