Skip to content

Commit

Permalink
hung task debugging: Inject NMI when hung and going to panic
Browse files Browse the repository at this point in the history
Send an NMI to all CPUs when a hung task is detected and the hung
task code is configured to panic. This gives us a fairly uptodate
snapshot of all CPUs in the system.

This lets us get stack trace of all CPUs which makes life easier
trying to debug a deadlock, and the NMI doesn't change anything
since the next step is a kernel panic.

Signed-off-by: Sasha Levin <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
[ extended the changelog a bit ]
Signed-off-by: Ingo Molnar <[email protected]>
  • Loading branch information
sashalevin authored and Ingo Molnar committed Apr 25, 2012
1 parent af3a3ab commit 625056b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kernel/hung_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)

touch_nmi_watchdog();

if (sysctl_hung_task_panic)
if (sysctl_hung_task_panic) {
trigger_all_cpu_backtrace();
panic("hung_task: blocked tasks");
}
}

/*
Expand Down

0 comments on commit 625056b

Please sign in to comment.