Skip to contentSkip to conversation

radix tree test suite: allow testing other fan-out values

PATCH New [email protected] 1 participant 1 message May 21, 2016 Xarray

lore
Share & tools
lore
#0 lore raw

PATCH 102/162 radix tree test suite: allow testing other fan-out values

From: Ross Zwisler <[email protected]>
Subject: radix tree test suite: allow testing other fan-out values

The defines in regression2.c are already in radix-tree.h and duplicating them in the test case makes experimenting with other values for the fan-out harder than necessary. Allow the user of the radix tree to decide what the fan-out should be rather than fixing it to 8 for non-kernel uses.

Cc Konstantin Khlebnikov <[email protected]>
Cc Kirill Shutemov <[email protected]>
Cc Jan Kara <[email protected]>
Cc Neil Brown <[email protected]>

---

 include/linux/radix-tree.h              |    4 +---
 tools/testing/radix-tree/linux/kernel.h |    2 ++
 tools/testing/radix-tree/regression2.c  |    7 -------
 3 files changed, 3 insertions(+), 10 deletions(-)
include/linux/radix-tree.h renamed from include/linux/radix-tree.h~radix-tree-test-suite-allow-testing-other-fan-out-values +1 -3
diff -puN include/linux/radix-tree.h~radix-tree-test-suite-allow-testing-other-fan-out-values include/linux/radix-tree.h
@@ -70,10 +70,8 @@ static inline int radix_tree_is_indirect
 
 #define RADIX_TREE_MAX_TAGS 3
 
-#ifdef __KERNEL__
+#ifndef RADIX_TREE_MAP_SHIFT
 #define RADIX_TREE_MAP_SHIFT	(CONFIG_BASE_SMALL ? 4 : 6)
-#else
-#define RADIX_TREE_MAP_SHIFT	3	/* For more stressful testing */
 #endif
 
 #define RADIX_TREE_MAP_SIZE	(1UL << RADIX_TREE_MAP_SHIFT)
tools/testing/radix-tree/linux/kernel.h renamed from tools/testing/radix-tree/linux/kernel.h~radix-tree-test-suite-allow-testing-other-fan-out-values +2 -0
diff -puN tools/testing/radix-tree/linux/kernel.h~radix-tree-test-suite-allow-testing-other-fan-out-values tools/testing/radix-tree/linux/kernel.h
@@ -12,6 +12,8 @@
 #define CONFIG_SHMEM
 #define CONFIG_SWAP
 
+#define RADIX_TREE_MAP_SHIFT	3
+
 #ifndef NULL
 #define NULL	0
 #endif
tools/testing/radix-tree/regression2.c renamed from tools/testing/radix-tree/regression2.c~radix-tree-test-suite-allow-testing-other-fan-out-values +0 -5
diff -puN tools/testing/radix-tree/regression2.c~radix-tree-test-suite-allow-testing-other-fan-out-values tools/testing/radix-tree/regression2.c
@@ -51,13 +51,6 @@
 
 #include "regression.h"
 
-#ifdef __KERNEL__
-#define RADIX_TREE_MAP_SHIFT    (CONFIG_BASE_SMALL ? 4 : 6)
-#else
-#define RADIX_TREE_MAP_SHIFT    3       /* For more stressful testing */
-#endif