Skip to content

Commit 88f1c87

Browse files
htejunIngo Molnar
authored andcommitted
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 <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent a97cb0e commit 88f1c87

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/locking/lockdep.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <linux/gfp.h>
5050
#include <linux/random.h>
5151
#include <linux/jhash.h>
52+
#include <linux/nmi.h>
5253

5354
#include <asm/sections.h>
5455

@@ -4490,6 +4491,7 @@ void debug_show_all_locks(void)
44904491
if (!unlock)
44914492
if (read_trylock(&tasklist_lock))
44924493
unlock = 1;
4494+
touch_nmi_watchdog();
44934495
} while_each_thread(g, p);
44944496

44954497
pr_warn("\n");

0 commit comments

Comments
 (0)