Skip to contentSkip to conversation

maple_tree-start-using-maple-copy-node-for-destination.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Mar 24

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: maple_tree: start using maple copy node for destination
has been removed from the -mm tree. Its filename was
maple_tree-start-using-maple-copy-node-for-destination.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: "Liam R. Howlett" <[email protected]>
Subject: maple_tree: start using maple copy node for destination
Date: Fri, 30 Jan 2026 15:59:22 -0500

Stop using the maple subtree state and big node in favour of using three destinations in the maple copy node. That is, expand the way leaves were handled to all levels of the tree and use the maple copy node to track the new nodes.

Extract out the sibling init into the data calculation since this is where the insufficient data can be detected. The remainder of the sibling code to shift the next iteration is moved to the spanning_ascend() function, since it is not always needed.

Next introduce the dst_setup() function which will decide how many nodes are needed to contain the data at this level. Using the destination count, populate the copy node's dst array with the new nodes and set d_count to the correct value. Note that this can be tricky in the case of a leaf node with exactly enough room because of the rule against NULLs at the end of leaves.

Once the destinations are ready, copy the data by altering the cp_data_write() function to copy from the sources to the destinations directly. This eliminates the use of the big node in this code path. On node completion, node_finalise() will zero out the remaining area and set the metadata, if necessary.

spanning_ascend() is used to decide if the operation is complete. It may create a new root, converge into one destination, or continue upwards by ascending the left and right write maple states.

One test case setup needed to be tweaked so that the targeted node was surrounded by full nodes.

[[email protected]: coding-style cleanups]
Cc Alice Ryhl <[email protected]>
Cc Andrew Ballance <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Christian Kujau <[email protected]>
Cc Geert Uytterhoeven <[email protected]>
Cc Kuninori Morimoto <[email protected]>
Cc Matthew Wilcox (Oracle) <[email protected]>
Cc SeongJae Park <[email protected]>
Cc Sidhartha Kumar <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>

---

 include/linux/maple_tree.h       |   14 
 lib/maple_tree.c                 |  628 ++++++++++++++++++++---------
 tools/testing/radix-tree/maple.c |    2 
 3 files changed, 460 insertions(+), 184 deletions(-)
include/linux/maple_tree.h renamed from include/linux/maple_tree.h~maple_tree-start-using-maple-copy-node-for-destination +14 -0
@@ -156,6 +156,17 @@ enum store_type {
 };
 
 struct maple_copy {
+	/*
+	 * min, max, and pivots are values
+	 * start, end, split are indexes into arrays
+	 * data is a size
+	 */
+
+	struct {
+		struct maple_node *node;
+		unsigned long max;
+		enum maple_type mt;
+	} dst[3];
 	struct {
 		struct maple_node *node;
 		unsigned long max;
@@ -178,7 +189,10 @@ struct maple_copy {
 
 	/*Avoid passing these around */
 	unsigned char s_count;
+	unsigned char d_count;
+	unsigned char split;
 	unsigned char data;
+	unsigned char height;
 };
 
 /**
lib/maple_tree.c renamed from lib/maple_tree.c~maple_tree-start-using-maple-copy-node-for-destination +445 -183

686 lines not on this page · raw message

tools/testing/radix-tree/maple.c renamed from tools/testing/radix-tree/maple.c~maple_tree-start-using-maple-copy-node-for-destination +1 -1
@@ -35508,7 +35508,7 @@ static noinline void __init check_spanni
 	/* Store a value across a node boundary that causes a 3 way split */
 
 	if (MAPLE_32BIT)
-		i = 49590; /* 0xc1b6 */
+		i = 49430; /* 0xc116 */
 	else
 		i = 49670; /* 0xC206 */
 

_

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