All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lockdep: Avoid triggering hardlockup from debug_show_all_locks()
@ 2018-01-22 22:00 Tejun Heo
  2018-01-23 19:03 ` Rik van Riel
  2018-01-24 10:38 ` [tip:locking/urgent] locking/lockdep: " tip-bot for Tejun Heo
  0 siblings, 2 replies; 10+ messages in thread
From: Tejun Heo @ 2018-01-22 22:00 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar; +Cc: linux-kernel, kernel-team

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>
---
 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 @@ void debug_show_all_locks(void)
 		if (!unlock)
 			if (read_trylock(&tasklist_lock))
 				unlock = 1;
+		touch_nmi_watchdog();
 	} while_each_thread(g, p);
 
 	pr_warn("\n");

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

end of thread, other threads:[~2018-01-24 19:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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:locking/urgent] locking/lockdep: " tip-bot for Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.