Skip to content

rust: allocator: Vmalloc: Support alignments larger than PAGE_SIZE

Hui Zhu linux-mm lkml llvm oe-kbuild-all rust-for-linux 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3vmalloc: Add vrealloc_align to support allocation of aligned vmap pagesinclude/linux/vmalloc.h mm/vmalloc.c+57 -281 reply
2/3rust: allocator: Vmalloc: Support alignments larger than PAGE_SIZErust/helpers/vmalloc.c rust/kernel/alloc/allocator.rs+27 -120 replies
3/3rust: add a sample allocator usagesamples/rust/Kconfig samples/rust/Makefile samples/rust/rust_allocator.rs+115 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] rust: allocator: Vmalloc: Support alignments larger than PAGE_SIZE

From: Hui Zhu <[email protected]>

There is a TODO in Vmalloc::realloc "Support alignments larger than PAGE_SIZE."

These commits make allocator vmalloc support alignments larger than PAGE_SIZE.
The function vrealloc_align is added to vmalloc.c to support reallocating aligned vmap pages.
When Vmalloc::realloc intends to reallocate memory aligned beyond PAGE_SIZE, vrealloc_align should be used instead of vrealloc, thus enabling support for alignments larger than PAGE_SIZE.
And add a sample to the samples memory allocator usage.

Hui Zhu (3):
vmalloc: Add vrealloc_align to support allocation of aligned vmap
pages
rust: allocator: Vmalloc: Support alignments larger than PAGE_SIZE
rust: add a sample allocator usage

 include/linux/vmalloc.h        |   5 ++
 mm/vmalloc.c                   |  80 ++++++++++++++++---------
 rust/helpers/vmalloc.c         |   7 +++
 rust/kernel/alloc/allocator.rs |  32 ++++++----
 samples/rust/Kconfig           |  10 ++++
 samples/rust/Makefile          |   1 +
 samples/rust/rust_allocator.rs | 104 +++++++++++++++++++++++++++++++++
 7 files changed, 199 insertions(+), 40 deletions(-)
 create mode 100644 samples/rust/rust_allocator.rs
Signature · 1 line
2.43.0