From: Liam R. Howlett Date: Mon, 5 Jul 2021 20:54:33 +0000 (-0400) Subject: test_maple_tree: Play with stress rcu timing X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=247740b53b3e681d29f3144ffeb8af08a17c8309;p=users%2Fjedix%2Flinux-maple.git test_maple_tree: Play with stress rcu timing Signed-off-by: Liam R. Howlett --- diff --git a/lib/test_maple_tree.c b/lib/test_maple_tree.c index 49460622f180..e4d9ef724949 100644 --- a/lib/test_maple_tree.c +++ b/lib/test_maple_tree.c @@ -36059,9 +36059,9 @@ static noinline void run_rcu_stress(struct maple_tree *mt, struct rcu_test_struct *vals) { - int i, count, max = 15000; + int i, count; void *(*function)(void*); - pthread_t readers[50]; + pthread_t readers[100]; bool toggle = true; void *expected = xa_mk_value(vals->toggle/10); @@ -36072,13 +36072,13 @@ void run_rcu_stress(struct maple_tree *mt, struct rcu_test_struct *vals) xa_mk_value(vals->removed/10), GFP_KERNEL); for (i = 0; i < ARRAY_SIZE(readers); i++) { - if (i < 9) + if (i < 19) function = rcu_empty; - else if (i < 19) + else if (i < 39) function = rcu_present; - else if (i < 29) + else if (i < 59) function = rcu_added; - else if (i < 39) + else if (i < 79) function = rcu_removed; else function = rcu_toggle; @@ -36089,8 +36089,8 @@ void run_rcu_stress(struct maple_tree *mt, struct rcu_test_struct *vals) } } - usleep(5); /* small yield to ensure all threads are at least started. */ - for (count = 0; count < max; count++) { + usleep(2); /* small yield to ensure all threads are at least started. */ + for (count = 0; count < vals->count; count++) { /* Add and modify */ mtree_store_range(mt, vals->index, vals->last, count % 2 ? vals->entry2 : vals->entry3, @@ -36109,7 +36109,7 @@ void run_rcu_stress(struct maple_tree *mt, struct rcu_test_struct *vals) mtree_store_range(mt, vals->toggle, vals->toggle, NULL, GFP_KERNEL); } - usleep(5); + usleep(50); } while (i--) pthread_join(readers[i], NULL); @@ -36415,8 +36415,8 @@ static noinline void check_rcu_threaded(struct maple_tree *mt) /* 4390-4395: value 439 (0x1b7) [0x36f] */ /* Store across several slots. */ /* Spanning store. */ - vals.loop_sleep = 3; - vals.count = 10000; + vals.loop_sleep = 7; + vals.count = 15000; vals.mt = mt; vals.index = 4390; vals.last = 4398;