From: Liam R. Howlett Date: Wed, 24 Sep 2025 14:02:21 +0000 (-0400) Subject: testing conversion and cleanup X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3bc13be2fb4970dadc43008267273c18885b6f38;p=users%2Fjedix%2Flinux-maple.git testing conversion and cleanup Signed-off-by: Liam R. Howlett --- diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 08033fa7a236..2a035d01d258 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -1333,11 +1333,16 @@ static noinline void __init check_ranges(struct maple_tree *mt) mt_validate(mt); } - check_store_range(mt, 8001, 8001, xa_mk_value(8001), 0); - check_store_range(mt, 8002, 8002, xa_mk_value(8002), 0); + val = 8000; + for (i = 1; i < 14; i++) { + val++; + check_store_range(mt, val, val + 1, xa_mk_value(val), 0); + mt_validate(mt); + } + - check_store_range(mt, 8081, 8081, xa_mk_value(8081), 0); - check_store_range(mt, 8082, 8082, xa_mk_value(8082), 0); + check_store_range(mt, 8051, 8051, xa_mk_value(8081), 0); + check_store_range(mt, 8052, 8052, xa_mk_value(8082), 0); check_store_range(mt, 8083, 8083, xa_mk_value(8083), 0); check_store_range(mt, 8084, 8084, xa_mk_value(8084), 0); check_store_range(mt, 8085, 8085, xa_mk_value(8085), 0); diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 45c1a0a6dd47..1d5abb2e3ca2 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -34433,18 +34433,20 @@ static void *rcu_reader_fwd(void *ptr) rcu_read_unlock(); goto quit; } - printk("start is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.index, mas.index, r_start, r_start); + printk("start is wrong: %lx (%lu) vs expected %lx (%lu)\n", + mas.index, mas.index, r_start, r_start); + RCU_MT_BUG_ON(test, mas.index != r_start); } - RCU_MT_BUG_ON(test, mas.index != r_start); if (mas.last != r_end) { if (pthread_mutex_trylock(&test->dump) != 0) { rcu_read_unlock(); goto quit; } - printk("last is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.last, mas.last, r_end, r_end); + printk("last is wrong: %lx (%lu) vs expected %lx (%lu)\n", + mas.last, mas.last, r_end, r_end); + RCU_MT_BUG_ON(test, mas.last != r_end); } - RCU_MT_BUG_ON(test, mas.last != r_end); if (i == reader->flip) { alt = xa_mk_value(index + i + RCU_RANGE_COUNT); @@ -34460,7 +34462,8 @@ static void *rcu_reader_fwd(void *ptr) else if (entry == alt) toggled = true; else { - printk("!!%lu-%lu -> %p not %p or %p\n", mas.index, mas.last, entry, expected, alt); + printk("!!%lu-%lu -> %p not %p or %p\n", + mas.index, mas.last, entry, expected, alt); RCU_MT_BUG_ON(test, 1); } @@ -34576,10 +34579,8 @@ static void *rcu_reader_rev(void *ptr) RCU_RANGE_COUNT); mt_dump(test->mt, mt_dump_dec); printk("Error: %p %lu-%lu %p != %lu-%lu %p %p line %d i %d\n", - mas.node, - mas.index, mas.last, entry, - r_start, r_end, expected, alt, - line, i); + mas.node, mas.index, mas.last, entry, + r_start, r_end, expected, alt, line, i); } RCU_MT_BUG_ON(test, mas.index != r_start); RCU_MT_BUG_ON(test, mas.last != r_end); @@ -35455,6 +35456,7 @@ static void check_dfs_preorder(struct maple_tree *mt) count++; mas_dfs_preorder(&mas); } while (!mas_is_none(&mas)); + /* printk("count %lu\n", count); */ MT_BUG_ON(mt, count != e); mtree_destroy(mt); @@ -35469,7 +35471,7 @@ static void check_dfs_preorder(struct maple_tree *mt) count++; mas_dfs_preorder(&mas); } while (!mas_is_none(&mas)); - /*printk("count %lu\n", count); */ + /* printk("count %lu\n", count); */ MT_BUG_ON(mt, count != e); mtree_destroy(mt); @@ -35481,7 +35483,7 @@ static void check_dfs_preorder(struct maple_tree *mt) count++; mas_dfs_preorder(&mas); } while (!mas_is_none(&mas)); - /*printk("count %lu\n", count); */ + /* printk("count %lu\n", count); */ MT_BUG_ON(mt, count != e); mtree_destroy(mt); @@ -35576,8 +35578,8 @@ static noinline void __init check_prealloc(struct maple_tree *mt) allocated = mas_allocated(&mas); height = mas_mt_height(&mas); vacant_height = get_vacant_height(&wr_mas, ptr); - MT_BUG_ON(mt, allocated == 0); - MT_BUG_ON(mt, allocated != 1 + (height - vacant_height) * 3); + MAS_BUG_ON(&mas, allocated == 0); + MAS_BUG_ON(&mas, allocated != 1 + (height - vacant_height) * 3); mas_destroy(&mas); allocated = mas_allocated(&mas); MT_BUG_ON(mt, allocated != 0);