Skip to contentSkip to conversation

radix-tree: add radix_tree_join

PATCH New [email protected] 1 participant 1 message Dec 14, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 101/114 radix-tree: add radix_tree_join

From: Matthew Wilcox <[email protected]>
Subject: radix-tree: add radix_tree_join

This new function allows for the replacement of many smaller entries in the radix tree with one larger multiorder entry. From the point of view of an RCU walker, they may see a mixture of the smaller entries and the large entry during the same walk, but they will never see NULL for an index which was populated before the join.

---

 include/linux/radix-tree.h            |    3 
 lib/radix-tree.c                      |  183 +++++++++++++++++++-----
 tools/testing/radix-tree/multiorder.c |   58 +++++++
 3 files changed, 213 insertions(+), 31 deletions(-)
include/linux/radix-tree.h renamed from include/linux/radix-tree.h~radix-tree-add-radix_tree_join +3 -0
diff -puN include/linux/radix-tree.h~radix-tree-add-radix_tree_join include/linux/radix-tree.h
@@ -335,6 +335,9 @@ static inline void radix_tree_preload_en
 	preempt_enable();
 }
 
+int radix_tree_join(struct radix_tree_root *, unsigned long index,
+			unsigned new_order, void *);
+
 #define RADIX_TREE_ITER_TAG_MASK	0x00FF	/* tag index in lower byte */
 #define RADIX_TREE_ITER_TAGGED		0x0100	/* lookup tagged slots */
 #define RADIX_TREE_ITER_CONTIG		0x0200	/* stop at first hole */
lib/radix-tree.c renamed from lib/radix-tree.c~radix-tree-add-radix_tree_join +152 -31

241 lines not on this page · raw message

tools/testing/radix-tree/multiorder.c renamed from tools/testing/radix-tree/multiorder.c~radix-tree-add-radix_tree_join +58 -0

68 lines not on this page · raw message

_