Skip to content

Commit 685a015

Browse files
tgrafdavem330
authored andcommitted
rhashtable: Allow other tasks to be scheduled in large lookup loops
Depending on system speed, the large lookup/insert/delete loops of the testsuite can take a considerable amount of time to complete causing watchdog warnings to appear. Allow other tasks to be scheduled throughout the loops. Reported-by: Meelis Roos <[email protected]> Signed-off-by: Thomas Graf <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent f61687c commit 685a015

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/test_rhashtable.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/rcupdate.h>
2121
#include <linux/rhashtable.h>
2222
#include <linux/slab.h>
23+
#include <linux/sched.h>
2324

2425
#define MAX_ENTRIES 1000000
2526
#define TEST_INSERT_FAIL INT_MAX
@@ -87,6 +88,8 @@ static int __init test_rht_lookup(struct rhashtable *ht)
8788
return -EINVAL;
8889
}
8990
}
91+
92+
cond_resched_rcu();
9093
}
9194

9295
return 0;
@@ -160,6 +163,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
160163
} else if (err) {
161164
return err;
162165
}
166+
167+
cond_resched();
163168
}
164169

165170
if (insert_fails)
@@ -183,6 +188,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
183188

184189
rhashtable_remove_fast(ht, &obj->node, test_rht_params);
185190
}
191+
192+
cond_resched();
186193
}
187194

188195
end = ktime_get_ns();

0 commit comments

Comments
 (0)