Skip to contentSkip to conversation

rust-maple_tree-add-mapletree.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 21, 2025

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: rust: maple_tree: add MapleTree
has been removed from the -mm tree. Its filename was
rust-maple_tree-add-mapletree.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Alice Ryhl <[email protected]>
Subject: rust: maple_tree: add MapleTree
Date: Tue, 02 Sep 2025 08:35:11 +0000

Patch series "Add Rust abstraction for Maple Trees", v3.

This will be used in the Tyr driver [1] to allocate from the GPU's VA space that is not owned by userspace, but by the kernel, for kernel GPU mappings.

Danilo tells me that in nouveau, the maple tree is used for keeping track of "VM regions" on top of GPUVM, and that he will most likely end up doing the same in the Rust Nova driver as well.

These abstractions intentionally do not expose any way to make use of external locking. You are required to use the internal spinlock. For now, we do not support loads that only utilize rcu for protection.

This contains some parts taken from Andrew Ballance's RFC [2] from April. However, it has also been reworked significantly compared to that RFC taking the use-cases in Tyr into account.

This patch (of 3):

The maple tree will be used in the Tyr driver to allocate and keep track of GPU allocations created internally (i.e. not by userspace). It will likely also be used in the Nova driver eventually.

This adds the simplest methods for additional and removal that do not require any special care with respect to concurrency.

This implementation is based on the RFC by Andrew but with significant changes to simplify the implementation.

---

 MAINTAINERS                |    4 
 include/linux/maple_tree.h |    3 
 rust/helpers/helpers.c     |    1 
 rust/helpers/maple_tree.c  |    8 
 rust/kernel/lib.rs         |    1 
 rust/kernel/maple_tree.rs  |  349 +++++++++++++++++++++++++++++++++++
 6 files changed, 366 insertions(+)
include/linux/maple_tree.h renamed from include/linux/maple_tree.h~rust-maple_tree-add-mapletree +3 -0
@@ -481,6 +481,9 @@ struct ma_wr_state {
 #define MA_ERROR(err) \
 		((struct maple_enode *)(((unsigned long)err << 2) | 2UL))
 
+/*
+ * When changing MA_STATE, remember to also change rust/kernel/maple_tree.rs
+ */
 #define MA_STATE(name, mt, first, end)					\
 	struct ma_state name = {					\
 		.tree = mt,						\
MAINTAINERS renamed from MAINTAINERS~rust-maple_tree-add-mapletree +4 -0
@@ -14672,6 +14672,8 @@ F:	net/mctp/
 
 MAPLE TREE
 M:	Liam R. Howlett <[email protected]>
+R:	Alice Ryhl <[email protected]>
+R:	Andrew Ballance <[email protected]>
 L:	[email protected]
 L:	[email protected]
 S:	Supported
@@ -14680,6 +14682,8 @@ F:	include/linux/maple_tree.h
 F:	include/trace/events/maple_tree.h
 F:	lib/maple_tree.c
 F:	lib/test_maple_tree.c
+F:	rust/helpers/maple_tree.c
+F:	rust/kernel/maple_tree.rs
 F:	tools/testing/radix-tree/maple.c
 F:	tools/testing/shared/linux/maple_tree.h
 
rust/helpers/helpers.c renamed from rust/helpers/helpers.c~rust-maple_tree-add-mapletree +1 -0
@@ -26,6 +26,7 @@
 #include "io.c"
 #include "jump_label.c"
 #include "kunit.c"
+#include "maple_tree.c"
 #include "mm.c"
 #include "mutex.c"
 #include "of.c"
rust/helpers/maple_tree.c new file +8 -0
new file mode 100644
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/maple_tree.h>
+
+void rust_helper_mt_init_flags(struct maple_tree *mt, unsigned int flags)
+{
+	mt_init_flags(mt, flags);
+}
rust/kernel/lib.rs renamed from rust/kernel/lib.rs~rust-maple_tree-add-mapletree +1 -0
@@ -96,6 +96,7 @@ pub mod jump_label;
 #[cfg(CONFIG_KUNIT)]
 pub mod kunit;
 pub mod list;
+pub mod maple_tree;
 pub mod miscdevice;
 pub mod mm;
 #[cfg(CONFIG_NET)]
rust/kernel/maple_tree.rs new file +349 -0

349 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are