Skip to content

Commit 094ffbd

Browse files
author
Matthew Wilcox (Oracle)
committed
idr test suite: Create anchor before launching throbber
The throbber could race with creation of the anchor entry and cause the IDR to have zero entries in it, which would cause the test to fail. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
1 parent 7035864 commit 094ffbd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tools/testing/radix-tree/idr-test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ void idr_find_test_1(int anchor_id, int throbber_id)
301301
pthread_t throbber;
302302
time_t start = time(NULL);
303303

304-
pthread_create(&throbber, NULL, idr_throbber, &throbber_id);
305-
306304
BUG_ON(idr_alloc(&find_idr, xa_mk_value(anchor_id), anchor_id,
307305
anchor_id + 1, GFP_KERNEL) != anchor_id);
308306

307+
pthread_create(&throbber, NULL, idr_throbber, &throbber_id);
308+
309309
rcu_read_lock();
310310
do {
311311
int id = 0;

0 commit comments

Comments
 (0)