netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] rhashtable-test: add cond_resched() to thread test
@ 2015-08-28 10:28 Phil Sutter
  2015-08-28 10:28 ` [PATCH 2/3] rhashtable-test: retry insert operations in threads Phil Sutter
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Phil Sutter @ 2015-08-28 10:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, tgraf, fengguang.wu, wfg, lkp

This should fix for soft lockup bugs triggered on slow systems.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 lib/test_rhashtable.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c
index 8c1ad1c..63654e3 100644
--- a/lib/test_rhashtable.c
+++ b/lib/test_rhashtable.c
@@ -236,6 +236,8 @@ static int thread_lookup_test(struct thread_data *tdata)
 			       obj->value, key);
 			err++;
 		}
+
+		cond_resched();
 	}
 	return err;
 }
@@ -251,6 +253,7 @@ static int threadfunc(void *data)
 
 	for (i = 0; i < entries; i++) {
 		tdata->objs[i].value = (tdata->id << 16) | i;
+		cond_resched();
 		err = rhashtable_insert_fast(&ht, &tdata->objs[i].node,
 		                             test_rht_params);
 		if (err == -ENOMEM || err == -EBUSY) {
@@ -285,6 +288,8 @@ static int threadfunc(void *data)
 				goto out;
 			}
 			tdata->objs[i].value = TEST_INSERT_FAIL;
+
+			cond_resched();
 		}
 		err = thread_lookup_test(tdata);
 		if (err) {
-- 
2.1.2

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2015-09-10 10:05 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-28 10:28 [PATCH 1/3] rhashtable-test: add cond_resched() to thread test Phil Sutter
2015-08-28 10:28 ` [PATCH 2/3] rhashtable-test: retry insert operations in threads Phil Sutter
2015-08-28 11:09   ` Thomas Graf
2015-08-28 11:13     ` Phil Sutter
2015-08-28 13:34       ` Phil Sutter
2015-08-28 22:43         ` Thomas Graf
2015-08-29  9:07           ` Phil Sutter
2015-08-30  7:47             ` Herbert Xu
2015-08-31 11:00               ` Phil Sutter
2015-09-01 11:43                 ` Herbert Xu
2015-09-01 12:46                   ` Phil Sutter
2015-09-01 13:00                     ` Herbert Xu
2015-09-01 13:40                       ` Eric Dumazet
2015-09-01 13:43                       ` Phil Sutter
2015-09-01 13:50                         ` Herbert Xu
2015-09-01 13:56                           ` Phil Sutter
2015-09-01 14:03                             ` Herbert Xu
2015-09-01 14:13                               ` Thomas Graf
2015-09-01 14:16                                 ` Herbert Xu
2015-09-01 14:51                                   ` Thomas Graf
2015-09-02  2:00                                     ` Herbert Xu
2015-09-02  7:07                                       ` Thomas Graf
2015-09-10  8:03                                     ` Herbert Xu
2015-09-10 10:05                                       ` Phil Sutter
2015-08-28 10:28 ` [PATCH 3/3] rhashtable-test: calculate max_entries value by default Phil Sutter
2015-08-28 11:11   ` Thomas Graf
2015-08-28 11:03 ` [PATCH 1/3] rhashtable-test: add cond_resched() to thread test Thomas Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).