]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
testing/radix-tree/maple: increase readers and reduce delay for faster machines
authorLiam R. Howlett <howlett@gmail.com>
Mon, 16 Jun 2025 18:45:19 +0000 (14:45 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:42:12 +0000 (22:42 -0700)
Faster machines may not see the initial or updated value in the race
condition.  Reduce the delay so that faster machines are less likely to
fail testing of the race conditions.

Link: https://lkml.kernel.org/r/20250616184521.3382795-2-Liam.Howlett@oracle.com
Signed-off-by: Liam R. Howlett <howlett@gmail.com>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Hailong Liu <hailong.liu@oppo.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Peng Zhang <zhangpeng.00@bytedance.com>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/radix-tree/maple.c

index 2c0b3830125336af760768597d39ed07a2f8e92b..f6f923c9dc1039997953a94ec184c560b225c2d4 100644 (file)
@@ -35062,7 +35062,7 @@ void run_check_rcu_slowread(struct maple_tree *mt, struct rcu_test_struct *vals)
 
        int i;
        void *(*function)(void *);
-       pthread_t readers[20];
+       pthread_t readers[30];
        unsigned int index = vals->index;
 
        mt_set_in_rcu(mt);
@@ -35080,14 +35080,14 @@ void run_check_rcu_slowread(struct maple_tree *mt, struct rcu_test_struct *vals)
                }
        }
 
-       usleep(5); /* small yield to ensure all threads are at least started. */
+       usleep(3); /* small yield to ensure all threads are at least started. */
 
        while (index <= vals->last) {
                mtree_store(mt, index,
                            (index % 2 ? vals->entry2 : vals->entry3),
                            GFP_KERNEL);
                index++;
-               usleep(5);
+               usleep(2);
        }
 
        while (i--)
@@ -35098,6 +35098,7 @@ void run_check_rcu_slowread(struct maple_tree *mt, struct rcu_test_struct *vals)
        MT_BUG_ON(mt, !vals->seen_entry3);
        MT_BUG_ON(mt, !vals->seen_both);
 }
+
 static noinline void __init check_rcu_simulated(struct maple_tree *mt)
 {
        unsigned long i, nr_entries = 1000;