path: root/kernel/hung_task.c
diff options
authorSasha Levin <>2012-03-15 21:47:20 (GMT)
committerIngo Molnar <>2012-04-25 10:39:25 (GMT)
commit625056b65ee9a8b4caf42136e0c844c15e6ec54f (patch)
treec9470f12694d950bf7e83c3539afa7dea02ba42f /kernel/hung_task.c
parentaf3a3ab2966112c0d0a44df7eeb1e95fe32d4495 (diff)
hung task debugging: Inject NMI when hung and going to panic
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 <> Cc: Linus Torvalds <> Cc: Andrew Morton <> Link: [ extended the changelog a bit ] Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'kernel/hung_task.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/hung_task.c b/kernel/hung_task.c
index c21449f..6df6149 100644
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -108,8 +108,10 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout)
- if (sysctl_hung_task_panic)
+ if (sysctl_hung_task_panic) {
+ trigger_all_cpu_backtrace();
panic("hung_task: blocked tasks");
+ }