]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
testing conversion and cleanup
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Sep 2025 14:02:21 +0000 (10:02 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Sep 2025 14:02:21 +0000 (10:02 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/test_maple_tree.c
tools/testing/radix-tree/maple.c

index 08033fa7a236b35420b4bd7c38c0dc0514c7eb8b..2a035d01d2587805c0c13347ee2e26a648bd6109 100644 (file)
@@ -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);
index 45c1a0a6dd47173e68243657a2b996b3f1d925cf..1d5abb2e3ca2f16e473528b7466946ccf9f3661a 100644 (file)
@@ -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);