radix-tree: add radix_tree_join
Subsystems (2)
[email protected]
maintainerPATCH 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.
Signed-off-by Matthew Wilcox <[email protected]>
Tested-by Kirill A. Shutemov <[email protected]>
Cc Konstantin Khlebnikov <[email protected]>
Cc Ross Zwisler <[email protected]>
Cc Matthew Wilcox <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
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
@@ -335,6 +335,9 @@ static inline void radix_tree_preload_enpreempt_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
_