提交 685a015e 编写于 作者: T Thomas Graf 提交者: David S. Miller

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: NMeelis Roos <mroos@linux.ee>
Signed-off-by: NThomas Graf <tgraf@suug.ch>
Acked-by: NEric Dumazet <edumazet@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f61687c0
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <linux/rcupdate.h> #include <linux/rcupdate.h>
#include <linux/rhashtable.h> #include <linux/rhashtable.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/sched.h>
#define MAX_ENTRIES 1000000 #define MAX_ENTRIES 1000000
#define TEST_INSERT_FAIL INT_MAX #define TEST_INSERT_FAIL INT_MAX
...@@ -87,6 +88,8 @@ static int __init test_rht_lookup(struct rhashtable *ht) ...@@ -87,6 +88,8 @@ static int __init test_rht_lookup(struct rhashtable *ht)
return -EINVAL; return -EINVAL;
} }
} }
cond_resched_rcu();
} }
return 0; return 0;
...@@ -160,6 +163,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht) ...@@ -160,6 +163,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
} else if (err) { } else if (err) {
return err; return err;
} }
cond_resched();
} }
if (insert_fails) if (insert_fails)
...@@ -183,6 +188,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht) ...@@ -183,6 +188,8 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
rhashtable_remove_fast(ht, &obj->node, test_rht_params); rhashtable_remove_fast(ht, &obj->node, test_rht_params);
} }
cond_resched();
} }
end = ktime_get_ns(); end = ktime_get_ns();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册