diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2016-09-30 06:38:28 -0400 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2016-09-30 06:38:28 -0400 |
| commit | d7e25c66c9bf882450060fd9464e784bd229d3ae (patch) | |
| tree | 0fb9525f91b11226a5a4b861cefd9fc5679f5c9b /tools | |
| parent | 907241dccb4ce5d9413cf3c030b32b0cfc184914 (diff) | |
| parent | e4aad64597d7a2455a541f904365b48d607916db (diff) | |
Merge branch 'x86/urgent' into x86/asm
Get the cr4 fixes so we can apply the final cleanup
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/testing/radix-tree/Makefile | 2 | ||||
| -rw-r--r-- | tools/testing/radix-tree/multiorder.c | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/tools/testing/radix-tree/Makefile b/tools/testing/radix-tree/Makefile index 3b530467148e..9d0919ed52a4 100644 --- a/tools/testing/radix-tree/Makefile +++ b/tools/testing/radix-tree/Makefile | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | 1 | ||
| 2 | CFLAGS += -I. -g -Wall -D_LGPL_SOURCE | 2 | CFLAGS += -I. -g -O2 -Wall -D_LGPL_SOURCE |
| 3 | LDFLAGS += -lpthread -lurcu | 3 | LDFLAGS += -lpthread -lurcu |
| 4 | TARGETS = main | 4 | TARGETS = main |
| 5 | OFILES = main.o radix-tree.o linux.o test.o tag_check.o find_next_bit.o \ | 5 | OFILES = main.o radix-tree.o linux.o test.o tag_check.o find_next_bit.o \ |
diff --git a/tools/testing/radix-tree/multiorder.c b/tools/testing/radix-tree/multiorder.c index 39d9b9568fe2..05d7bc488971 100644 --- a/tools/testing/radix-tree/multiorder.c +++ b/tools/testing/radix-tree/multiorder.c | |||
| @@ -124,6 +124,8 @@ static void multiorder_check(unsigned long index, int order) | |||
| 124 | unsigned long i; | 124 | unsigned long i; |
| 125 | unsigned long min = index & ~((1UL << order) - 1); | 125 | unsigned long min = index & ~((1UL << order) - 1); |
| 126 | unsigned long max = min + (1UL << order); | 126 | unsigned long max = min + (1UL << order); |
| 127 | void **slot; | ||
| 128 | struct item *item2 = item_create(min); | ||
| 127 | RADIX_TREE(tree, GFP_KERNEL); | 129 | RADIX_TREE(tree, GFP_KERNEL); |
| 128 | 130 | ||
| 129 | printf("Multiorder index %ld, order %d\n", index, order); | 131 | printf("Multiorder index %ld, order %d\n", index, order); |
| @@ -139,13 +141,19 @@ static void multiorder_check(unsigned long index, int order) | |||
| 139 | item_check_absent(&tree, i); | 141 | item_check_absent(&tree, i); |
| 140 | for (i = max; i < 2*max; i++) | 142 | for (i = max; i < 2*max; i++) |
| 141 | item_check_absent(&tree, i); | 143 | item_check_absent(&tree, i); |
| 144 | for (i = min; i < max; i++) | ||
| 145 | assert(radix_tree_insert(&tree, i, item2) == -EEXIST); | ||
| 146 | |||
| 147 | slot = radix_tree_lookup_slot(&tree, index); | ||
| 148 | free(*slot); | ||
| 149 | radix_tree_replace_slot(slot, item2); | ||
| 142 | for (i = min; i < max; i++) { | 150 | for (i = min; i < max; i++) { |
| 143 | static void *entry = (void *) | 151 | struct item *item = item_lookup(&tree, i); |
| 144 | (0xA0 | RADIX_TREE_EXCEPTIONAL_ENTRY); | 152 | assert(item != 0); |
| 145 | assert(radix_tree_insert(&tree, i, entry) == -EEXIST); | 153 | assert(item->index == min); |
| 146 | } | 154 | } |
| 147 | 155 | ||
| 148 | assert(item_delete(&tree, index) != 0); | 156 | assert(item_delete(&tree, min) != 0); |
| 149 | 157 | ||
| 150 | for (i = 0; i < 2*max; i++) | 158 | for (i = 0; i < 2*max; i++) |
| 151 | item_check_absent(&tree, i); | 159 | item_check_absent(&tree, i); |
