提交 cd5b318d 编写于 作者: P Phil Sutter 提交者: David S. Miller

rhashtable-test: add cond_resched() to thread test

This should fix for soft lockup bugs triggered on slow systems.
Signed-off-by: NPhil Sutter <phil@nwl.cc>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 3d40e443
...@@ -236,6 +236,8 @@ static int thread_lookup_test(struct thread_data *tdata) ...@@ -236,6 +236,8 @@ static int thread_lookup_test(struct thread_data *tdata)
obj->value, key); obj->value, key);
err++; err++;
} }
cond_resched();
} }
return err; return err;
} }
...@@ -251,6 +253,7 @@ static int threadfunc(void *data) ...@@ -251,6 +253,7 @@ static int threadfunc(void *data)
for (i = 0; i < entries; i++) { for (i = 0; i < entries; i++) {
tdata->objs[i].value = (tdata->id << 16) | i; tdata->objs[i].value = (tdata->id << 16) | i;
cond_resched();
err = rhashtable_insert_fast(&ht, &tdata->objs[i].node, err = rhashtable_insert_fast(&ht, &tdata->objs[i].node,
test_rht_params); test_rht_params);
if (err == -ENOMEM || err == -EBUSY) { if (err == -ENOMEM || err == -EBUSY) {
...@@ -285,6 +288,8 @@ static int threadfunc(void *data) ...@@ -285,6 +288,8 @@ static int threadfunc(void *data)
goto out; goto out;
} }
tdata->objs[i].value = TEST_INSERT_FAIL; tdata->objs[i].value = TEST_INSERT_FAIL;
cond_resched();
} }
err = thread_lookup_test(tdata); err = thread_lookup_test(tdata);
if (err) { if (err) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册