linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Tejun Heo <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com,
	peterz@infradead.org, mingo@kernel.org, tj@kernel.org,
	torvalds@linux-foundation.org, tglx@linutronix.de
Subject: [tip:locking/urgent] locking/lockdep: Avoid triggering hardlockup from debug_show_all_locks()
Date: Wed, 24 Jan 2018 02:38:22 -0800	[thread overview]
Message-ID: <tip-88f1c87de11a86d839f4ce5313e552d96709b990@git.kernel.org> (raw)
In-Reply-To: <20180122220055.GB1771050@devbig577.frc2.facebook.com>

Commit-ID:  88f1c87de11a86d839f4ce5313e552d96709b990
Gitweb:     https://git.kernel.org/tip/88f1c87de11a86d839f4ce5313e552d96709b990
Author:     Tejun Heo <tj@kernel.org>
AuthorDate: Mon, 22 Jan 2018 14:00:55 -0800
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 24 Jan 2018 10:00:09 +0100

locking/lockdep: Avoid triggering hardlockup from debug_show_all_locks()

debug_show_all_locks() iterates all tasks and print held locks whole
holding tasklist_lock.  This can take a while on a slow console device
and may end up triggering NMI hardlockup detector if someone else ends
up waiting for tasklist_lock.

Touch the NMI watchdog while printing the held locks to avoid
spuriously triggering the hardlockup detector.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-team@fb.com
Link: http://lkml.kernel.org/r/20180122220055.GB1771050@devbig577.frc2.facebook.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/locking/lockdep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 5fa1324..5216590 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -49,6 +49,7 @@
 #include <linux/gfp.h>
 #include <linux/random.h>
 #include <linux/jhash.h>
+#include <linux/nmi.h>
 
 #include <asm/sections.h>
 
@@ -4490,6 +4491,7 @@ retry:
 		if (!unlock)
 			if (read_trylock(&tasklist_lock))
 				unlock = 1;
+		touch_nmi_watchdog();
 	} while_each_thread(g, p);
 
 	pr_warn("\n");

      parent reply	other threads:[~2018-01-24 10:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-22 22:00 [PATCH] lockdep: Avoid triggering hardlockup from debug_show_all_locks() Tejun Heo
2018-01-23 19:03 ` Rik van Riel
2018-01-23 20:57   ` Tejun Heo
2018-01-23 21:00     ` Steven Rostedt
2018-01-23 21:11       ` Tejun Heo
2018-01-24  2:49         ` Sergey Senozhatsky
2018-01-24  2:54           ` Steven Rostedt
2018-01-24  5:00             ` Sergey Senozhatsky
2018-01-24 19:10               ` Tejun Heo
2018-01-24 10:38 ` tip-bot for Tejun Heo [this message]

Reply instructions:

You may reply publicly 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=tip-88f1c87de11a86d839f4ce5313e552d96709b990@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).