summaryrefslogtreecommitdiff
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-07-22 17:58:40 +0200
committerClark Williams <williams@redhat.com>2012-03-24 10:26:14 -0500
commit328ee5164ddaac0b9e37010b2e35b193eeb23cfe (patch)
tree31c50f5e2aaa5de0695364b0ca60acb8b65de09b /kernel/watchdog.c
parentd9de053b154ff1c39b3fcaa3cb26b1a877e77976 (diff)
printk-kill.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 1d7bca7f4f52..c7e2a2fa6d54 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -201,6 +201,8 @@ static int is_softlockup(unsigned long touch_ts)
#ifdef CONFIG_HARDLOCKUP_DETECTOR
+static DEFINE_RAW_SPINLOCK(watchdog_output_lock);
+
static struct perf_event_attr wd_hw_attr = {
.type = PERF_TYPE_HARDWARE,
.config = PERF_COUNT_HW_CPU_CYCLES,
@@ -235,10 +237,19 @@ static void watchdog_overflow_callback(struct perf_event *event,
if (__this_cpu_read(hard_watchdog_warn) == true)
return;
- if (hardlockup_panic)
+ /*
+ * If early-printk is enabled then make sure we do not
+ * lock up in printk() and kill console logging:
+ */
+ printk_kill();
+
+ if (hardlockup_panic) {
panic("Watchdog detected hard LOCKUP on cpu %d", this_cpu);
- else
+ } else {
+ raw_spin_lock(&watchdog_output_lock);
WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu);
+ raw_spin_unlock(&watchdog_output_lock);
+ }
__this_cpu_write(hard_watchdog_warn, true);
return;