linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hung task: NMI when hung and going to panic
@ 2012-03-15 21:47 Sasha Levin
  2012-04-25 13:53 ` [tip:core/locking] hung task debugging: Inject " tip-bot for Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2012-03-15 21:47 UTC (permalink / raw)
  To: linux-kernel; +Cc: mingo, akpm, tglx, hpa, Sasha Levin

NMI all CPUs when detected a hung task and the hung task code is configured
to panic.

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 <levinsasha928@gmail.com>
---
 kernel/hung_task.c |    4 +++-
 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)
 
 	touch_nmi_watchdog();
 
-	if (sysctl_hung_task_panic)
+	if (sysctl_hung_task_panic) {
+		trigger_all_cpu_backtrace();
 		panic("hung_task: blocked tasks");
+	}
 }
 
 /*
-- 
1.7.8.4


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

* [tip:core/locking] hung task debugging: Inject NMI when hung and going to panic
  2012-03-15 21:47 [PATCH] hung task: NMI when hung and going to panic Sasha Levin
@ 2012-04-25 13:53 ` tip-bot for Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Sasha Levin @ 2012-04-25 13:53 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, levinsasha928, hpa, mingo, akpm, torvalds, tglx

Commit-ID:  625056b65ee9a8b4caf42136e0c844c15e6ec54f
Gitweb:     http://git.kernel.org/tip/625056b65ee9a8b4caf42136e0c844c15e6ec54f
Author:     Sasha Levin <levinsasha928@gmail.com>
AuthorDate: Thu, 15 Mar 2012 17:47:20 -0400
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 25 Apr 2012 12:39:25 +0200

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 <levinsasha928@gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Link: http://lkml.kernel.org/r/1331848040-1676-1-git-send-email-levinsasha928@gmail.com
[ extended the changelog a bit ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 kernel/hung_task.c |    4 +++-
 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)
 
 	touch_nmi_watchdog();
 
-	if (sysctl_hung_task_panic)
+	if (sysctl_hung_task_panic) {
+		trigger_all_cpu_backtrace();
 		panic("hung_task: blocked tasks");
+	}
 }
 
 /*

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

end of thread, other threads:[~2012-04-25 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-15 21:47 [PATCH] hung task: NMI when hung and going to panic Sasha Levin
2012-04-25 13:53 ` [tip:core/locking] hung task debugging: Inject " tip-bot for Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).