1da668aa1SThomas Huth /*
2da668aa1SThomas Huth * rcuq_test.c
3da668aa1SThomas Huth *
4da668aa1SThomas Huth * usage: rcuq_test <readers> <duration>
5da668aa1SThomas Huth *
6da668aa1SThomas Huth * This program is free software; you can redistribute it and/or modify
7da668aa1SThomas Huth * it under the terms of the GNU General Public License as published by
8da668aa1SThomas Huth * the Free Software Foundation; either version 2 of the License, or
9da668aa1SThomas Huth * (at your option) any later version.
10da668aa1SThomas Huth *
11da668aa1SThomas Huth * This program is distributed in the hope that it will be useful,
12da668aa1SThomas Huth * but WITHOUT ANY WARRANTY; without even the implied warranty of
13da668aa1SThomas Huth * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14da668aa1SThomas Huth * GNU General Public License for more details.
15da668aa1SThomas Huth *
16da668aa1SThomas Huth * You should have received a copy of the GNU General Public License
17*0c201cc1SKhadija Kamran * along with this program. If not, see <https://www.gnu.org/licenses/>.
18da668aa1SThomas Huth *
19da668aa1SThomas Huth * Copyright (c) 2013 Mike D. Day, IBM Corporation.
20da668aa1SThomas Huth */
21da668aa1SThomas Huth
22da668aa1SThomas Huth #include "qemu/osdep.h"
23da668aa1SThomas Huth #include "qemu/atomic.h"
24da668aa1SThomas Huth #include "qemu/rcu.h"
25da668aa1SThomas Huth #include "qemu/thread.h"
26da668aa1SThomas Huth #include "qemu/rcu_queue.h"
27da668aa1SThomas Huth
28da668aa1SThomas Huth /*
29da668aa1SThomas Huth * Test variables.
30da668aa1SThomas Huth */
31da668aa1SThomas Huth
32da668aa1SThomas Huth static QemuMutex counts_mutex;
33da668aa1SThomas Huth static long long n_reads = 0LL;
34da668aa1SThomas Huth static long long n_updates = 0LL;
35da668aa1SThomas Huth static int64_t n_reclaims;
36da668aa1SThomas Huth static int64_t n_nodes_removed;
37da668aa1SThomas Huth static long long n_nodes = 0LL;
38da668aa1SThomas Huth static int g_test_in_charge = 0;
39da668aa1SThomas Huth
40da668aa1SThomas Huth static int nthreadsrunning;
41da668aa1SThomas Huth
42da668aa1SThomas Huth #define GOFLAG_INIT 0
43da668aa1SThomas Huth #define GOFLAG_RUN 1
44da668aa1SThomas Huth #define GOFLAG_STOP 2
45da668aa1SThomas Huth
46da668aa1SThomas Huth static int goflag = GOFLAG_INIT;
47da668aa1SThomas Huth
48da668aa1SThomas Huth #define RCU_READ_RUN 1000
49da668aa1SThomas Huth #define RCU_UPDATE_RUN 10
50da668aa1SThomas Huth #define NR_THREADS 100
51da668aa1SThomas Huth #define RCU_Q_LEN 100
52da668aa1SThomas Huth
53da668aa1SThomas Huth static QemuThread threads[NR_THREADS];
54da668aa1SThomas Huth static struct rcu_reader_data *data[NR_THREADS];
55da668aa1SThomas Huth static int n_threads;
56da668aa1SThomas Huth
select_random_el(int max)57da668aa1SThomas Huth static int select_random_el(int max)
58da668aa1SThomas Huth {
59da668aa1SThomas Huth return (rand() % max);
60da668aa1SThomas Huth }
61da668aa1SThomas Huth
62da668aa1SThomas Huth
create_thread(void * (* func)(void *))63da668aa1SThomas Huth static void create_thread(void *(*func)(void *))
64da668aa1SThomas Huth {
65da668aa1SThomas Huth if (n_threads >= NR_THREADS) {
66da668aa1SThomas Huth fprintf(stderr, "Thread limit of %d exceeded!\n", NR_THREADS);
67da668aa1SThomas Huth exit(-1);
68da668aa1SThomas Huth }
69da668aa1SThomas Huth qemu_thread_create(&threads[n_threads], "test", func, &data[n_threads],
70da668aa1SThomas Huth QEMU_THREAD_JOINABLE);
71da668aa1SThomas Huth n_threads++;
72da668aa1SThomas Huth }
73da668aa1SThomas Huth
wait_all_threads(void)74da668aa1SThomas Huth static void wait_all_threads(void)
75da668aa1SThomas Huth {
76da668aa1SThomas Huth int i;
77da668aa1SThomas Huth
78da668aa1SThomas Huth for (i = 0; i < n_threads; i++) {
79da668aa1SThomas Huth qemu_thread_join(&threads[i]);
80da668aa1SThomas Huth }
81da668aa1SThomas Huth n_threads = 0;
82da668aa1SThomas Huth }
83da668aa1SThomas Huth
84da668aa1SThomas Huth #ifndef TEST_LIST_TYPE
85da668aa1SThomas Huth #define TEST_LIST_TYPE 1
86da668aa1SThomas Huth #endif
87da668aa1SThomas Huth
88da668aa1SThomas Huth struct list_element {
89da668aa1SThomas Huth #if TEST_LIST_TYPE == 1
90da668aa1SThomas Huth QLIST_ENTRY(list_element) entry;
91da668aa1SThomas Huth #elif TEST_LIST_TYPE == 2
92da668aa1SThomas Huth QSIMPLEQ_ENTRY(list_element) entry;
93da668aa1SThomas Huth #elif TEST_LIST_TYPE == 3
94da668aa1SThomas Huth QTAILQ_ENTRY(list_element) entry;
95da668aa1SThomas Huth #elif TEST_LIST_TYPE == 4
96da668aa1SThomas Huth QSLIST_ENTRY(list_element) entry;
97da668aa1SThomas Huth #else
98da668aa1SThomas Huth #error Invalid TEST_LIST_TYPE
99da668aa1SThomas Huth #endif
100da668aa1SThomas Huth struct rcu_head rcu;
101da668aa1SThomas Huth };
102da668aa1SThomas Huth
reclaim_list_el(struct rcu_head * prcu)103da668aa1SThomas Huth static void reclaim_list_el(struct rcu_head *prcu)
104da668aa1SThomas Huth {
105da668aa1SThomas Huth struct list_element *el = container_of(prcu, struct list_element, rcu);
106da668aa1SThomas Huth g_free(el);
107da668aa1SThomas Huth /* Accessed only from call_rcu thread. */
108da668aa1SThomas Huth qatomic_set_i64(&n_reclaims, n_reclaims + 1);
109da668aa1SThomas Huth }
110da668aa1SThomas Huth
111da668aa1SThomas Huth #if TEST_LIST_TYPE == 1
112da668aa1SThomas Huth static QLIST_HEAD(, list_element) Q_list_head;
113da668aa1SThomas Huth
114da668aa1SThomas Huth #define TEST_NAME "qlist"
115da668aa1SThomas Huth #define TEST_LIST_REMOVE_RCU QLIST_REMOVE_RCU
116da668aa1SThomas Huth #define TEST_LIST_INSERT_AFTER_RCU QLIST_INSERT_AFTER_RCU
117da668aa1SThomas Huth #define TEST_LIST_INSERT_HEAD_RCU QLIST_INSERT_HEAD_RCU
118da668aa1SThomas Huth #define TEST_LIST_FOREACH_RCU QLIST_FOREACH_RCU
119da668aa1SThomas Huth #define TEST_LIST_FOREACH_SAFE_RCU QLIST_FOREACH_SAFE_RCU
120da668aa1SThomas Huth
121da668aa1SThomas Huth #elif TEST_LIST_TYPE == 2
122da668aa1SThomas Huth static QSIMPLEQ_HEAD(, list_element) Q_list_head =
123da668aa1SThomas Huth QSIMPLEQ_HEAD_INITIALIZER(Q_list_head);
124da668aa1SThomas Huth
125da668aa1SThomas Huth #define TEST_NAME "qsimpleq"
126da668aa1SThomas Huth #define TEST_LIST_REMOVE_RCU(el, f) \
127da668aa1SThomas Huth QSIMPLEQ_REMOVE_RCU(&Q_list_head, el, list_element, f)
128da668aa1SThomas Huth
129da668aa1SThomas Huth #define TEST_LIST_INSERT_AFTER_RCU(list_el, el, f) \
130da668aa1SThomas Huth QSIMPLEQ_INSERT_AFTER_RCU(&Q_list_head, list_el, el, f)
131da668aa1SThomas Huth
132da668aa1SThomas Huth #define TEST_LIST_INSERT_HEAD_RCU QSIMPLEQ_INSERT_HEAD_RCU
133da668aa1SThomas Huth #define TEST_LIST_FOREACH_RCU QSIMPLEQ_FOREACH_RCU
134da668aa1SThomas Huth #define TEST_LIST_FOREACH_SAFE_RCU QSIMPLEQ_FOREACH_SAFE_RCU
135da668aa1SThomas Huth
136da668aa1SThomas Huth #elif TEST_LIST_TYPE == 3
137da668aa1SThomas Huth static QTAILQ_HEAD(, list_element) Q_list_head;
138da668aa1SThomas Huth
139da668aa1SThomas Huth #define TEST_NAME "qtailq"
140da668aa1SThomas Huth #define TEST_LIST_REMOVE_RCU(el, f) QTAILQ_REMOVE_RCU(&Q_list_head, el, f)
141da668aa1SThomas Huth
142da668aa1SThomas Huth #define TEST_LIST_INSERT_AFTER_RCU(list_el, el, f) \
143da668aa1SThomas Huth QTAILQ_INSERT_AFTER_RCU(&Q_list_head, list_el, el, f)
144da668aa1SThomas Huth
145da668aa1SThomas Huth #define TEST_LIST_INSERT_HEAD_RCU QTAILQ_INSERT_HEAD_RCU
146da668aa1SThomas Huth #define TEST_LIST_FOREACH_RCU QTAILQ_FOREACH_RCU
147da668aa1SThomas Huth #define TEST_LIST_FOREACH_SAFE_RCU QTAILQ_FOREACH_SAFE_RCU
148da668aa1SThomas Huth
149da668aa1SThomas Huth #elif TEST_LIST_TYPE == 4
150da668aa1SThomas Huth static QSLIST_HEAD(, list_element) Q_list_head;
151da668aa1SThomas Huth
152da668aa1SThomas Huth #define TEST_NAME "qslist"
153da668aa1SThomas Huth #define TEST_LIST_REMOVE_RCU(el, f) \
154da668aa1SThomas Huth QSLIST_REMOVE_RCU(&Q_list_head, el, list_element, f)
155da668aa1SThomas Huth
156da668aa1SThomas Huth #define TEST_LIST_INSERT_AFTER_RCU(list_el, el, f) \
157da668aa1SThomas Huth QSLIST_INSERT_AFTER_RCU(&Q_list_head, list_el, el, f)
158da668aa1SThomas Huth
159da668aa1SThomas Huth #define TEST_LIST_INSERT_HEAD_RCU QSLIST_INSERT_HEAD_RCU
160da668aa1SThomas Huth #define TEST_LIST_FOREACH_RCU QSLIST_FOREACH_RCU
161da668aa1SThomas Huth #define TEST_LIST_FOREACH_SAFE_RCU QSLIST_FOREACH_SAFE_RCU
162da668aa1SThomas Huth #else
163da668aa1SThomas Huth #error Invalid TEST_LIST_TYPE
164da668aa1SThomas Huth #endif
165da668aa1SThomas Huth
rcu_q_reader(void * arg)166da668aa1SThomas Huth static void *rcu_q_reader(void *arg)
167da668aa1SThomas Huth {
168da668aa1SThomas Huth long long n_reads_local = 0;
169da668aa1SThomas Huth struct list_element *el;
170da668aa1SThomas Huth
171da668aa1SThomas Huth rcu_register_thread();
172da668aa1SThomas Huth
17317c78154SStefan Hajnoczi *(struct rcu_reader_data **)arg = get_ptr_rcu_reader();
174da668aa1SThomas Huth qatomic_inc(&nthreadsrunning);
175da668aa1SThomas Huth while (qatomic_read(&goflag) == GOFLAG_INIT) {
176da668aa1SThomas Huth g_usleep(1000);
177da668aa1SThomas Huth }
178da668aa1SThomas Huth
179da668aa1SThomas Huth while (qatomic_read(&goflag) == GOFLAG_RUN) {
180da668aa1SThomas Huth rcu_read_lock();
181da668aa1SThomas Huth TEST_LIST_FOREACH_RCU(el, &Q_list_head, entry) {
182da668aa1SThomas Huth n_reads_local++;
183da668aa1SThomas Huth if (qatomic_read(&goflag) == GOFLAG_STOP) {
184da668aa1SThomas Huth break;
185da668aa1SThomas Huth }
186da668aa1SThomas Huth }
187da668aa1SThomas Huth rcu_read_unlock();
188da668aa1SThomas Huth
189da668aa1SThomas Huth g_usleep(100);
190da668aa1SThomas Huth }
191da668aa1SThomas Huth qemu_mutex_lock(&counts_mutex);
192da668aa1SThomas Huth n_reads += n_reads_local;
193da668aa1SThomas Huth qemu_mutex_unlock(&counts_mutex);
194da668aa1SThomas Huth
195da668aa1SThomas Huth rcu_unregister_thread();
196da668aa1SThomas Huth return NULL;
197da668aa1SThomas Huth }
198da668aa1SThomas Huth
199da668aa1SThomas Huth
rcu_q_updater(void * arg)200da668aa1SThomas Huth static void *rcu_q_updater(void *arg)
201da668aa1SThomas Huth {
202da668aa1SThomas Huth int j, target_el;
203da668aa1SThomas Huth long long n_nodes_local = 0;
204da668aa1SThomas Huth long long n_updates_local = 0;
205da668aa1SThomas Huth long long n_removed_local = 0;
206da668aa1SThomas Huth struct list_element *el, *prev_el;
207da668aa1SThomas Huth
20817c78154SStefan Hajnoczi *(struct rcu_reader_data **)arg = get_ptr_rcu_reader();
209da668aa1SThomas Huth qatomic_inc(&nthreadsrunning);
210da668aa1SThomas Huth while (qatomic_read(&goflag) == GOFLAG_INIT) {
211da668aa1SThomas Huth g_usleep(1000);
212da668aa1SThomas Huth }
213da668aa1SThomas Huth
214da668aa1SThomas Huth while (qatomic_read(&goflag) == GOFLAG_RUN) {
215da668aa1SThomas Huth target_el = select_random_el(RCU_Q_LEN);
216da668aa1SThomas Huth j = 0;
217da668aa1SThomas Huth /* FOREACH_RCU could work here but let's use both macros */
218da668aa1SThomas Huth TEST_LIST_FOREACH_SAFE_RCU(prev_el, &Q_list_head, entry, el) {
219da668aa1SThomas Huth j++;
220da668aa1SThomas Huth if (target_el == j) {
221da668aa1SThomas Huth TEST_LIST_REMOVE_RCU(prev_el, entry);
222da668aa1SThomas Huth /* may be more than one updater in the future */
223da668aa1SThomas Huth call_rcu1(&prev_el->rcu, reclaim_list_el);
224da668aa1SThomas Huth n_removed_local++;
225da668aa1SThomas Huth break;
226da668aa1SThomas Huth }
227da668aa1SThomas Huth }
228da668aa1SThomas Huth if (qatomic_read(&goflag) == GOFLAG_STOP) {
229da668aa1SThomas Huth break;
230da668aa1SThomas Huth }
231da668aa1SThomas Huth target_el = select_random_el(RCU_Q_LEN);
232da668aa1SThomas Huth j = 0;
233da668aa1SThomas Huth TEST_LIST_FOREACH_RCU(el, &Q_list_head, entry) {
234da668aa1SThomas Huth j++;
235da668aa1SThomas Huth if (target_el == j) {
236da668aa1SThomas Huth struct list_element *new_el = g_new(struct list_element, 1);
237da668aa1SThomas Huth n_nodes_local++;
238da668aa1SThomas Huth TEST_LIST_INSERT_AFTER_RCU(el, new_el, entry);
239da668aa1SThomas Huth break;
240da668aa1SThomas Huth }
241da668aa1SThomas Huth }
242da668aa1SThomas Huth
243da668aa1SThomas Huth n_updates_local += 2;
244da668aa1SThomas Huth synchronize_rcu();
245da668aa1SThomas Huth }
246da668aa1SThomas Huth synchronize_rcu();
247da668aa1SThomas Huth qemu_mutex_lock(&counts_mutex);
248da668aa1SThomas Huth n_nodes += n_nodes_local;
249da668aa1SThomas Huth n_updates += n_updates_local;
250da668aa1SThomas Huth qatomic_set_i64(&n_nodes_removed, n_nodes_removed + n_removed_local);
251da668aa1SThomas Huth qemu_mutex_unlock(&counts_mutex);
252da668aa1SThomas Huth return NULL;
253da668aa1SThomas Huth }
254da668aa1SThomas Huth
rcu_qtest_init(void)255da668aa1SThomas Huth static void rcu_qtest_init(void)
256da668aa1SThomas Huth {
257da668aa1SThomas Huth struct list_element *new_el;
258da668aa1SThomas Huth int i;
259da668aa1SThomas Huth nthreadsrunning = 0;
260da668aa1SThomas Huth srand(time(0));
261da668aa1SThomas Huth for (i = 0; i < RCU_Q_LEN; i++) {
262da668aa1SThomas Huth new_el = g_new(struct list_element, 1);
263da668aa1SThomas Huth TEST_LIST_INSERT_HEAD_RCU(&Q_list_head, new_el, entry);
264da668aa1SThomas Huth }
265da668aa1SThomas Huth qemu_mutex_lock(&counts_mutex);
266da668aa1SThomas Huth n_nodes += RCU_Q_LEN;
267da668aa1SThomas Huth qemu_mutex_unlock(&counts_mutex);
268da668aa1SThomas Huth }
269da668aa1SThomas Huth
rcu_qtest_run(int duration,int nreaders)270da668aa1SThomas Huth static void rcu_qtest_run(int duration, int nreaders)
271da668aa1SThomas Huth {
272da668aa1SThomas Huth int nthreads = nreaders + 1;
273da668aa1SThomas Huth while (qatomic_read(&nthreadsrunning) < nthreads) {
274da668aa1SThomas Huth g_usleep(1000);
275da668aa1SThomas Huth }
276da668aa1SThomas Huth
277da668aa1SThomas Huth qatomic_set(&goflag, GOFLAG_RUN);
278da668aa1SThomas Huth sleep(duration);
279da668aa1SThomas Huth qatomic_set(&goflag, GOFLAG_STOP);
280da668aa1SThomas Huth wait_all_threads();
281da668aa1SThomas Huth }
282da668aa1SThomas Huth
283da668aa1SThomas Huth
rcu_qtest(const char * test,int duration,int nreaders)284da668aa1SThomas Huth static void rcu_qtest(const char *test, int duration, int nreaders)
285da668aa1SThomas Huth {
286da668aa1SThomas Huth int i;
287da668aa1SThomas Huth long long n_removed_local = 0;
288da668aa1SThomas Huth
289da668aa1SThomas Huth struct list_element *el, *prev_el;
290da668aa1SThomas Huth
291da668aa1SThomas Huth rcu_qtest_init();
292da668aa1SThomas Huth for (i = 0; i < nreaders; i++) {
293da668aa1SThomas Huth create_thread(rcu_q_reader);
294da668aa1SThomas Huth }
295da668aa1SThomas Huth create_thread(rcu_q_updater);
296da668aa1SThomas Huth rcu_qtest_run(duration, nreaders);
297da668aa1SThomas Huth
298da668aa1SThomas Huth TEST_LIST_FOREACH_SAFE_RCU(prev_el, &Q_list_head, entry, el) {
299da668aa1SThomas Huth TEST_LIST_REMOVE_RCU(prev_el, entry);
300da668aa1SThomas Huth call_rcu1(&prev_el->rcu, reclaim_list_el);
301da668aa1SThomas Huth n_removed_local++;
302da668aa1SThomas Huth }
303da668aa1SThomas Huth qemu_mutex_lock(&counts_mutex);
304da668aa1SThomas Huth qatomic_set_i64(&n_nodes_removed, n_nodes_removed + n_removed_local);
305da668aa1SThomas Huth qemu_mutex_unlock(&counts_mutex);
306da668aa1SThomas Huth synchronize_rcu();
307da668aa1SThomas Huth while (qatomic_read_i64(&n_nodes_removed) >
308da668aa1SThomas Huth qatomic_read_i64(&n_reclaims)) {
309da668aa1SThomas Huth g_usleep(100);
310da668aa1SThomas Huth synchronize_rcu();
311da668aa1SThomas Huth }
312da668aa1SThomas Huth if (g_test_in_charge) {
313da668aa1SThomas Huth g_assert_cmpint(qatomic_read_i64(&n_nodes_removed), ==,
314da668aa1SThomas Huth qatomic_read_i64(&n_reclaims));
315da668aa1SThomas Huth } else {
316da668aa1SThomas Huth printf("%s: %d readers; 1 updater; nodes read: " \
317da668aa1SThomas Huth "%lld, nodes removed: %"PRIi64"; nodes reclaimed: %"PRIi64"\n",
318da668aa1SThomas Huth test, nthreadsrunning - 1, n_reads,
319da668aa1SThomas Huth qatomic_read_i64(&n_nodes_removed),
320da668aa1SThomas Huth qatomic_read_i64(&n_reclaims));
321da668aa1SThomas Huth exit(0);
322da668aa1SThomas Huth }
323da668aa1SThomas Huth }
324da668aa1SThomas Huth
usage(int argc,char * argv[])325da668aa1SThomas Huth static void usage(int argc, char *argv[])
326da668aa1SThomas Huth {
327da668aa1SThomas Huth fprintf(stderr, "Usage: %s duration nreaders\n", argv[0]);
328da668aa1SThomas Huth exit(-1);
329da668aa1SThomas Huth }
330da668aa1SThomas Huth
331da668aa1SThomas Huth static int gtest_seconds;
332da668aa1SThomas Huth
gtest_rcuq_one(void)333da668aa1SThomas Huth static void gtest_rcuq_one(void)
334da668aa1SThomas Huth {
335da668aa1SThomas Huth rcu_qtest("rcuqtest", gtest_seconds / 4, 1);
336da668aa1SThomas Huth }
337da668aa1SThomas Huth
gtest_rcuq_few(void)338da668aa1SThomas Huth static void gtest_rcuq_few(void)
339da668aa1SThomas Huth {
340da668aa1SThomas Huth rcu_qtest("rcuqtest", gtest_seconds / 4, 5);
341da668aa1SThomas Huth }
342da668aa1SThomas Huth
gtest_rcuq_many(void)343da668aa1SThomas Huth static void gtest_rcuq_many(void)
344da668aa1SThomas Huth {
345da668aa1SThomas Huth rcu_qtest("rcuqtest", gtest_seconds / 2, 20);
346da668aa1SThomas Huth }
347da668aa1SThomas Huth
348da668aa1SThomas Huth
main(int argc,char * argv[])349da668aa1SThomas Huth int main(int argc, char *argv[])
350da668aa1SThomas Huth {
351da668aa1SThomas Huth int duration = 0, readers = 0;
352da668aa1SThomas Huth
353da668aa1SThomas Huth qemu_mutex_init(&counts_mutex);
354da668aa1SThomas Huth if (argc >= 2) {
355da668aa1SThomas Huth if (argv[1][0] == '-') {
356da668aa1SThomas Huth g_test_init(&argc, &argv, NULL);
357da668aa1SThomas Huth if (g_test_quick()) {
358da668aa1SThomas Huth gtest_seconds = 4;
359da668aa1SThomas Huth } else {
360da668aa1SThomas Huth gtest_seconds = 20;
361da668aa1SThomas Huth }
362da668aa1SThomas Huth g_test_add_func("/rcu/"TEST_NAME"/single-threaded", gtest_rcuq_one);
363da668aa1SThomas Huth g_test_add_func("/rcu/"TEST_NAME"/short-few", gtest_rcuq_few);
364da668aa1SThomas Huth g_test_add_func("/rcu/"TEST_NAME"/long-many", gtest_rcuq_many);
365da668aa1SThomas Huth g_test_in_charge = 1;
366da668aa1SThomas Huth return g_test_run();
367da668aa1SThomas Huth }
368da668aa1SThomas Huth duration = strtoul(argv[1], NULL, 0);
369da668aa1SThomas Huth }
370da668aa1SThomas Huth if (argc >= 3) {
371da668aa1SThomas Huth readers = strtoul(argv[2], NULL, 0);
372da668aa1SThomas Huth }
373da668aa1SThomas Huth if (duration && readers) {
374da668aa1SThomas Huth rcu_qtest(argv[0], duration, readers);
375da668aa1SThomas Huth return 0;
376da668aa1SThomas Huth }
377da668aa1SThomas Huth
378da668aa1SThomas Huth usage(argc, argv);
379da668aa1SThomas Huth return -1;
380da668aa1SThomas Huth }
381