Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163280AbbKTRRY (ORCPT ); Fri, 20 Nov 2015 12:17:24 -0500 Received: from orbit.nwl.cc ([176.31.251.142]:51375 "EHLO mail.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759664AbbKTRRX (ORCPT ); Fri, 20 Nov 2015 12:17:23 -0500 From: Phil Sutter To: davem@davemloft.net Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tgraf@suug.ch, fengguang.wu@intel.com, wfg@linux.intel.com, lkp@01.org Subject: [PATCH v2 1/4] rhashtable-test: add cond_resched() to thread test Date: Fri, 20 Nov 2015 18:17:17 +0100 Message-Id: <1448039840-11367-2-git-send-email-phil@nwl.cc> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1448039840-11367-1-git-send-email-phil@nwl.cc> References: <1448039840-11367-1-git-send-email-phil@nwl.cc> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1248 Lines: 45 This should fix for soft lockup bugs triggered on slow systems. Signed-off-by: Phil Sutter --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/