]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
test_maple_tree: Play with stress rcu timing
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 5 Jul 2021 20:54:33 +0000 (16:54 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Mon, 5 Jul 2021 20:54:33 +0000 (16:54 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
lib/test_maple_tree.c

index 49460622f180924182534ed06c05cea09f4bae79..e4d9ef724949d7813653e169c48e9df2e48d0c77 100644 (file)
@@ -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;