rust: alloc: implement `Vmalloc` allocator
authorDanilo Krummrich <dakr@kernel.org>
Fri, 4 Oct 2024 15:41:12 +0000 (17:41 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 15 Oct 2024 20:56:59 +0000 (22:56 +0200)
commit61c004781d6b928443052e7a6cf84b35d4f61401
tree658dcd52aeb70c7bdace12eee020f1acea6682a0
parent5a888c28e3b4ff6f54a53fca33951537d135e7f1
rust: alloc: implement `Vmalloc` allocator

Implement `Allocator` for `Vmalloc`, the kernel's virtually contiguous
allocator, typically used for larger objects, (much) larger than page
size.

All memory allocations made with `Vmalloc` end up in `vrealloc()`.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Benno Lossin <benno.lossin@proton.me>
Reviewed-by: Gary Guo <gary@garyguo.net>
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/r/20241004154149.93856-9-dakr@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/helpers/helpers.c
rust/helpers/vmalloc.c [new file with mode: 0644]
rust/kernel/alloc/allocator.rs
rust/kernel/alloc/allocator_test.rs