]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
force_more issue, rcu detecting issues split_w_structs
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 11 Jun 2025 15:01:47 +0000 (11:01 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 11 Jun 2025 15:01:47 +0000 (11:01 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
lib/maple_tree.c
tools/testing/radix-tree/maple.c

index 4538db620e4e01dd7341bbb845174abfdef19f22..11f7664cdaf872bf41d5793581bde7626b9508af 100644 (file)
@@ -5161,7 +5161,7 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas)
                                printk("r_parent insert off is now %u\n",
                                       r_parent.insert_off);
                                printk("Looks like there is a right sibling\n");
-                       } else if (parent.insert_off) {
+                       } else if (!force_more && parent.insert_off) {
                                printk("%d: set src %u\n", __LINE__, s);
                                src[0] = &other;
                                s++;
@@ -5306,6 +5306,11 @@ static void mas_wr_spanning_store(struct ma_wr_state *wr_mas)
                                printk("set dst %u max %lu\n", d, dst[d].max);
                                d++;
                                printk("dst ++\n");
+                               if ((d > 2) && (sd.offset <= sd.new_end)) {
+                                       mt_dump(mas->tree, mt_dump_dec);
+                                       printk("d will be out of range\n");
+                                       fflush(stdout);
+                               }
                        }
 
                        /* Source exhausted */
index 8cb08b5257abca61fc3b4147cf6c3df5a50ac07d..4488866749f18f08e2217722cd0cd30471d1b2cd 100644 (file)
@@ -44,6 +44,7 @@ struct rcu_test_struct2 {
 
        unsigned long index[RCU_RANGE_COUNT];
        unsigned long last[RCU_RANGE_COUNT];
+       pthread_mutex_t dump;
 };
 
 struct rcu_test_struct3 {
@@ -34552,6 +34553,11 @@ static void *rcu_reader_rev(void *ptr)
                                line = __LINE__;
 
                        if (mas.index != r_start) {
+                               if (pthread_mutex_trylock(&test->dump) != 0) {
+                                       rcu_read_unlock();
+                                       goto quit;
+                               }
+
                                alt = xa_mk_value(index + i * 2 + 1 +
                                                  RCU_RANGE_COUNT);
                                mt_dump(test->mt, mt_dump_dec);
@@ -34613,6 +34619,7 @@ static void *rcu_reader_rev(void *ptr)
                usleep(test->pause);
        }
 
+quit:
        rcu_unregister_thread();
        return NULL;
 }
@@ -34762,6 +34769,7 @@ static void rcu_stress(struct maple_tree *mt, bool forward)
        test.seen_modified = 0;
        test.thread_count = 0;
        test.start = test.stop = false;
+       pthread_mutex_init(&test.dump, NULL);
        seed = time(NULL);
        srand(seed);
        for (i = 0; i < RCU_RANGE_COUNT; i++) {