LKML Archive on lore.kernel.org
 help / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: Fengguang Wu <fengguang.wu@intel.com>, akpm@linux-foundation.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>,
	linux-kernel@vger.kernel.org,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [interval_tree_test_init] BUG: soft lockup - CPU#0 stuck for 23s! [swapper/0:1]
Date: Thu, 9 Nov 2017 08:17:15 -0800
Message-ID: <20171109161715.xai2dtwqw2frhkcm@linux-n805> (raw)
In-Reply-To: <20171108072630.slkrvukmhmkx6igd@wfg-t540p.sh.intel.com>

On Wed, 08 Nov 2017, Fengguang Wu wrote:

>On Tue, Nov 07, 2017 at 08:58:14AM -0800, Davidlohr Bueso wrote:
>>On Tue, 07 Nov 2017, Fengguang Wu wrote:
>>
>>>[  265.102312] xz_dec_test: module loaded
>>>[  265.111774] xz_dec_test: Create a device node with 'mknod xz_dec_test c 246 0' and write .xz files to it.
>>>[  265.160320] atomic64_test: passed for x86-64 platform with CX8 and with SSE
>>>[  265.181966] glob: 64 self-tests passed, 0 failed
>>>[  265.196996] interval tree insert/remove
>>>[  292.348094] watchdog: BUG: soft lockup - CPU#0 stuck for 23s! [swapper/0:1]
>>>[  292.348094] irq event stamp: 6190340
>>>[  292.396418] hardirqs last  enabled at (6190339): [<ffffffff81fb006b>] restore_regs_and_iret+0x0/0x1d
>>>[  292.396418] hardirqs last disabled at (6190340): [<ffffffff81fb0cb8>] apic_timer_interrupt+0x98/0xb0
>>>[  292.396418] softirqs last  enabled at (6182242): [<ffffffff81fb2942>] __do_softirq+0x382/0x3f7
>>>[  292.396418] softirqs last disabled at (6182235): [<ffffffff810b6696>] irq_exit+0x51/0x7b
>>>[  292.396418] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.14.0-rc8 #40
>>>[  292.396418] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
>>>[  292.396418] task: ffff880072bf4040 task.stack: ffffc9000031c000
>>>[  292.396418] RIP: 0010:interval_tree_insert+0x4c/0xd4
>>
>>That would be:
>>
>>    for (i = 0; i < perf_loops; i++) {
>>	 for (j = 0; j < nnodes; j++)
>>		interval_tree_insert(nodes + j, &root);
>>	 for (j = 0; j < nnodes; j++)
>>		interval_tree_remove(nodes + j, &root);
>>    }
>>
>>Which if you are using the default params would end up doing insert() 10 million times.
>>How about decrementing perf_loops, it's pretty high.
>
>It works! Thank you!
>
>Tested-by: Fengguang Wu <fengguang.wu@intel.com>
>
>Fengguang
>
>>diff --git a/lib/interval_tree_test.c b/lib/interval_tree_test.c
>>index 0e343fd29570..1dbdf3704247 100644
>>--- a/lib/interval_tree_test.c
>>+++ b/lib/interval_tree_test.c
>>@@ -11,7 +11,7 @@
>>       MODULE_PARM_DESC(name, msg);
>>
>>__param(int, nnodes, 100, "Number of nodes in the interval tree");
>>-__param(int, perf_loops, 100000, "Number of iterations modifying the tree");
>>+__param(int, perf_loops, 1000, "Number of iterations modifying the tree");
>>
>>__param(int, nsearches, 100, "Number of searches to the interval tree");
>>__param(int, search_loops, 10000, "Number of iterations searching the tree");
>>
>>If that works I guess we'd have to limit the max values for such parameters
>>to avoid soft lockups. The same applies to your rbtree test report.

I've decided to not do this as different users might be ok with the risk,
just not the default.

Cc'ing akpm.

Thanks,
Davidlohr

--------8<--------------------------------------------------
[PATCH] lib/rbtree-test: lower default params

Fengguang reported soft lockups while running the rbtree
and interval tree test modules. The logic for these tests
all occur in init phase, and we currently are pounding
with the default values for number of nodes and number
of iterations of each test. Reduce the later by two
orders of magnitude. This does not influence the value
of the tests in that one thousand times by default is
enough to get the picture.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
---
 lib/interval_tree_test.c | 4 ++--
 lib/rbtree_test.c        | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/interval_tree_test.c b/lib/interval_tree_test.c
index 0e343fd29570..835242e74aaa 100644
--- a/lib/interval_tree_test.c
+++ b/lib/interval_tree_test.c
@@ -11,10 +11,10 @@
 	MODULE_PARM_DESC(name, msg);
 
 __param(int, nnodes, 100, "Number of nodes in the interval tree");
-__param(int, perf_loops, 100000, "Number of iterations modifying the tree");
+__param(int, perf_loops, 1000, "Number of iterations modifying the tree");
 
 __param(int, nsearches, 100, "Number of searches to the interval tree");
-__param(int, search_loops, 10000, "Number of iterations searching the tree");
+__param(int, search_loops, 1000, "Number of iterations searching the tree");
 __param(bool, search_all, false, "Searches will iterate all nodes in the tree");
 
 __param(uint, max_endpoint, ~0, "Largest value for the interval's endpoint");
diff --git a/lib/rbtree_test.c b/lib/rbtree_test.c
index 191a238e5a9d..7d36c1e27ff6 100644
--- a/lib/rbtree_test.c
+++ b/lib/rbtree_test.c
@@ -11,7 +11,7 @@
 	MODULE_PARM_DESC(name, msg);
 
 __param(int, nnodes, 100, "Number of nodes in the rb-tree");
-__param(int, perf_loops, 100000, "Number of iterations modifying the rb-tree");
+__param(int, perf_loops, 1000, "Number of iterations modifying the rb-tree");
 __param(int, check_loops, 100, "Number of iterations modifying and verifying the rb-tree");
 
 struct test_node {
-- 
2.13.6

      reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-07  4:41 Fengguang Wu
2017-11-07 16:58 ` Davidlohr Bueso
2017-11-08  7:26   ` Fengguang Wu
2017-11-09 16:17     ` Davidlohr Bueso [this message]

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171109161715.xai2dtwqw2frhkcm@linux-n805 \
    --to=dave@stgolabs.net \
    --cc=akpm@linux-foundation.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox