rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH WIP 0/8] Draft: Alternative allocator support
@ 2024-04-29 20:11 Danilo Krummrich
  2024-04-29 20:11 ` [PATCH WIP 1/8] rust: alloc: re-enable allocator_api Danilo Krummrich
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Danilo Krummrich @ 2024-04-29 20:11 UTC (permalink / raw)
  To: ojeda, alex.gaynor, wedsonaf, boqun.feng, gary, bjorn3_gh,
	benno.lossin, a.hindborg, aliceryhl, ajanulgu, zhiw, acurrid,
	cjia, jhubbard
  Cc: rust-for-linux, Danilo Krummrich

DISCLAIMER: This patch series does not raise a claim for inclusion in the kernel
(yet) and, instead, serves as a baseline for further discussion.

Hi,

This patch series re-enables the allocator_api and implements an extension trait
AllocatorWithFlags expanding the Allocator trait to allow for arbitrary
allocator implementations.

It expands Box<T, A> and Vec<T, A> by adding the BoxExtAlloc<T, A> and
VecExtAlloc<T, A> traits analogous to the existing BoxExt<T> and VecExt<T>
traits and, as an example, implements the VmAllocator (vmalloc).

This patch series is tested (I tested the VecExtAlloc<T, A> parts using my
firmware abstractions) and it seems to work quite well. However, since it's just
a draft there are no proper commit messages, no documentation and no safety
comments.

Also, I'm pretty sure there are some parts of BoxExtAlloc<T, A> and
VecExtAlloc<T, A> that, somehow, can be generalized with the existing BoxExt<T>
and VecExt<T> implementations.

Please let me know what you think.

- Danilo

Danilo Krummrich (8):
  rust: alloc: re-enable allocator_api
  rust: alloc: use AllocError from core::alloc
  rust: alloc: implement AllocatorWithFlags trait
  rust: alloc: separate krealloc_aligned()
  rust: alloc: implement AllocatorWithFlags for KernelAllocator
  rust: alloc: implement BoxExtAlloc
  rust: alloc: implement VecExtAlloc
  rust: alloc: implement vmalloc allocator

 rust/kernel/alloc.rs           |  25 ++++++--
 rust/kernel/alloc/allocator.rs | 103 ++++++++++++++++++++++++++++++---
 rust/kernel/alloc/box_ext.rs   |  41 ++++++++++++-
 rust/kernel/alloc/vec_ext.rs   |  86 ++++++++++++++++++++++++++-
 rust/kernel/error.rs           |   3 +-
 rust/kernel/init.rs            |   3 +-
 rust/kernel/lib.rs             |   1 +
 rust/kernel/str.rs             |   3 +-
 rust/kernel/sync/arc.rs        |   4 +-
 rust/kernel/workqueue.rs       |   3 +-
 10 files changed, 251 insertions(+), 21 deletions(-)


base-commit: 2c1092853f163762ef0aabc551a630ef233e1be3
-- 
2.44.0


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-05-06 13:17 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-29 20:11 [PATCH WIP 0/8] Draft: Alternative allocator support Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 1/8] rust: alloc: re-enable allocator_api Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 2/8] rust: alloc: use AllocError from core::alloc Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 3/8] rust: alloc: implement AllocatorWithFlags trait Danilo Krummrich
2024-05-01  8:32   ` Benno Lossin
2024-05-01 12:50     ` Danilo Krummrich
2024-05-01 15:39       ` Benno Lossin
2024-05-01 15:48         ` Danilo Krummrich
2024-05-01 21:38       ` Miguel Ojeda
2024-05-03 15:27       ` Gary Guo
2024-05-06 13:17         ` Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 4/8] rust: alloc: separate krealloc_aligned() Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 5/8] rust: alloc: implement AllocatorWithFlags for KernelAllocator Danilo Krummrich
2024-05-01  8:44   ` Benno Lossin
2024-05-01 12:52     ` Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 6/8] rust: alloc: implement BoxExtAlloc Danilo Krummrich
2024-05-01  8:53   ` Benno Lossin
2024-05-01 13:06     ` Danilo Krummrich
2024-05-01 15:46       ` Benno Lossin
2024-05-01 17:30         ` Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 7/8] rust: alloc: implement VecExtAlloc Danilo Krummrich
2024-04-29 20:11 ` [PATCH WIP 8/8] rust: alloc: implement vmalloc allocator Danilo Krummrich
2024-05-01 21:32 ` [PATCH WIP 0/8] Draft: Alternative allocator support Miguel Ojeda
2024-05-01 22:31   ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).