]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
testing output
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 1 Sep 2025 06:08:49 +0000 (02:08 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Mon, 1 Sep 2025 06:08:49 +0000 (02:08 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c
tools/testing/radix-tree/maple.c

index 90c080bb318b386346ba9ae0af8782fd758d8321..a296d8964ee4fd11f2925b1be9cc3f9aa4007206 100644 (file)
@@ -2921,8 +2921,8 @@ unsigned long node_copy(struct ma_state *mas, struct maple_node *src,
                struct maple_enode *edst = mt_mk_node(dst, d_mt);
 
                printk("dst %p d_slots %p %p\n", dst, d_slots, *d_slots);
-               printk("d_start %u\n", d_start);
                for (int i = 0; i < size; i++) {
+                       printk("d_start %u + i = %u\n", d_start, d_start + i);
                        printk("set slot %u parent\n", i);
                        printk("d_slots = %p\n", d_slots[i]);
                        mas_set_parent(mas, d_slots[i], edst, d_start + i);
@@ -2963,8 +2963,10 @@ unsigned long node_copy(struct ma_state *mas, struct maple_node *src,
 //     printk("cp from %p -> %p %u\n", d_pivots, s_pivots, size);
        fflush(stdout);
        size--;
-       if (size)
+       if (size) {
+               printk("memcpy pivots of size %u\n", size);
                memcpy(d_pivots, s_pivots, size * sizeof(unsigned long));
+       }
 
        return d_max;
 }
@@ -2981,6 +2983,8 @@ void node_finalise(struct maple_node *node, enum maple_type mt, unsigned char en
        gaps = ma_gaps(node, mt);
        if (end < max_end - 1) {
                size = max_end - end;
+
+               printk("Clear %u - %u\n", end, end + size - 1);
                memset(ma_slots(node, mt) + end, 0, size * sizeof(void*));
 
                if (gaps)
@@ -3114,6 +3118,7 @@ void spanning_split_dest_setup(struct maple_copy *cp, struct ma_state *mas,
                cp->split = (cp->data + 2) / 3;
                cp->d_count = 3;
        }
+       printk("split %u data %u d_count %u\n", cp->split, cp->data, cp->d_count);
 
        for (int i = 0; i < cp->d_count; i++) {
                cp->dst[i].mt = mt;
@@ -3152,7 +3157,7 @@ void spanning_split_src_setup(struct maple_copy *cp, struct ma_state *mas,
 
                append_node_cp(cp, l_wr_mas->mas, 0, off);
                cp->src[cp->s_count - 1].max = cp->min - 1;
-               printk("Use pivot %p [%u]\n", l_wr_mas->node, off);
+               printk("->>src %u max is %lx\n", cp->s_count - 1,cp->min - 1);
        }
 
        printk("cp min is %lx\n", cp->min);
@@ -3312,7 +3317,9 @@ void spanning_data_write(struct maple_copy *cp, struct ma_state *mas)
                        data_offset--;
                        dst_offset--;
                        cp->dst[d].max = ma_pivots(dst, d_mt)[dst_offset - 1];
+                       printk("%d: RESET set dest max %lx\n", __LINE__, cp->dst[d].max);
                }
+
                node_finalise(dst, d_mt, dst_offset);
                //mt_dump_node(mas->tree, mt_mk_node(dst, d_mt), 0, ULONG_MAX, 1, mt_dump_hex);
                if (d >= cp->d_count) {
@@ -3631,15 +3638,10 @@ static void mas_wr_spanning_rebalance(struct ma_state *mas,
                printk("\nlmas %p rmas %p\n", l_wr_mas->node, r_wr_mas->node);
 
                cp.height++;
-               printk("%d: cp min %lx\n", __LINE__, cp.min);
                spanning_data_calc(&cp, mas, l_wr_mas, r_wr_mas, &sib);
-               printk("%d: cp min %lx\n", __LINE__, cp.min);
                spanning_split_dest_setup(&cp, mas, l_wr_mas->type);
-               printk("%d: cp min %lx\n", __LINE__, cp.min);
                spanning_split_src_setup(&cp, mas, l_wr_mas, r_wr_mas, &sib);
-               printk("%d: cp min %lx\n", __LINE__, cp.min);
                spanning_data_write(&cp, mas);
-               printk("%d: cp min %lx\n", __LINE__, cp.min);
 #if 0
                if (debug < 2)
        {
index 7118eea67fa57ea062f9aa961b37a8f404f343b7..99cdd94b2f128efe7502babae73e47005e5430ba 100644 (file)
@@ -34435,7 +34435,7 @@ static void *rcu_reader_fwd(void *ptr)
                                        goto quit;
                                }
                                fflush(stdout);
-                               printk("start is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.index, mas.index, r_start, r_start);
+                               printk("Error 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);
 
@@ -34445,7 +34445,7 @@ static void *rcu_reader_fwd(void *ptr)
                                        goto quit;
                                }
                                fflush(stdout);
-                               printk("last is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.last, mas.last, r_end, r_end);
+                               printk("Error 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);
 
@@ -34578,6 +34578,7 @@ static void *rcu_reader_rev(void *ptr)
                                alt = xa_mk_value(index + i * 2 + 1 +
                                                  RCU_RANGE_COUNT);
                                mt_dump(test->mt, mt_dump_dec);
+                               fflush(stdout);
                                printk("Error: %p %lu-%lu %p != %lu-%lu %p %p line %d i %d\n",
                                       mas.node,
                                       mas.index, mas.last, entry,
@@ -34801,6 +34802,11 @@ static void rcu_stress(struct maple_tree *mt, bool forward)
                seed = 1 + r + rand() % 10;
        }
 
+       mt_validate(mt);
+
+       printk("TREE START BEFORE TEST\n");
+       mt_dump(mt, mt_dump_hex);
+
        i = count = ARRAY_SIZE(readers);
        while (i--) {
                unsigned long id;