Commit 88f1c87d authored by Tejun Heo's avatar Tejun Heo Committed by Ingo Molnar

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: default avatarTejun Heo <tj@kernel.org>
Signed-off-by: default avatarPeter 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.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent a97cb0e7
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/random.h> #include <linux/random.h>
#include <linux/jhash.h> #include <linux/jhash.h>
#include <linux/nmi.h>
#include <asm/sections.h> #include <asm/sections.h>
...@@ -4490,6 +4491,7 @@ void debug_show_all_locks(void) ...@@ -4490,6 +4491,7 @@ void debug_show_all_locks(void)
if (!unlock) if (!unlock)
if (read_trylock(&tasklist_lock)) if (read_trylock(&tasklist_lock))
unlock = 1; unlock = 1;
touch_nmi_watchdog();
} while_each_thread(g, p); } while_each_thread(g, p);
pr_warn("\n"); pr_warn("\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment