From: Liam R. Howlett Date: Wed, 11 Jun 2025 15:01:47 +0000 (-0400) Subject: force_more issue, rcu detecting issues X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=cfba3bf5fe81e240622843e2a8c00daf560eb3e4;p=users%2Fjedix%2Flinux-maple.git force_more issue, rcu detecting issues Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 4538db620e4e..11f7664cdaf8 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -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 */ diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 8cb08b5257ab..4488866749f1 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -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++) {