aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/watchdog.c
diff options
context:
space:
mode:
authorDon Zickus <dzickus@redhat.com>2010-05-07 17:11:51 -0400
committerFrederic Weisbecker <fweisbec@gmail.com>2010-05-12 17:55:55 -0400
commitd7c547335fa6b0090fa09c46ea0e965ac273a27e (patch)
tree66d082cb7acbfc59a2af6bf24130d4832da2919e /kernel/watchdog.c
parent10f9014912a2b1cb59c39cdea777e6d9afa8f17e (diff)
lockup_detector: Separate touch_nmi_watchdog code path from touch_watchdog
When I combined the nmi_watchdog (hardlockup) and softlockup code, I also combined the paths the touch_watchdog and touch_nmi_watchdog took. This may not be the best idea as pointed out by Frederic W., that the touch_watchdog case probably should not reset the hardlockup count. Therefore the patch below falls back to the previous idea of keeping the touch_nmi_watchdog a superset of the touch_watchdog case. Signed-off-by: Don Zickus <dzickus@redhat.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Cyrill Gorcunov <gorcunov@gmail.com> Cc: Eric Paris <eparis@redhat.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> LKML-Reference: <1273266711-18706-9-git-send-email-dzickus@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r--kernel/watchdog.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index f1541b7e3244..57b8e2c25eda 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -31,6 +31,7 @@ int watchdog_enabled;
31int __read_mostly softlockup_thresh = 60; 31int __read_mostly softlockup_thresh = 60;
32 32
33static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts); 33static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts);
34static DEFINE_PER_CPU(bool, watchdog_nmi_touch);
34static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog); 35static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog);
35static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer); 36static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer);
36static DEFINE_PER_CPU(bool, softlockup_touch_sync); 37static DEFINE_PER_CPU(bool, softlockup_touch_sync);
@@ -139,6 +140,7 @@ void touch_all_softlockup_watchdogs(void)
139 140
140void touch_nmi_watchdog(void) 141void touch_nmi_watchdog(void)
141{ 142{
143 __get_cpu_var(watchdog_nmi_touch) = true;
142 touch_softlockup_watchdog(); 144 touch_softlockup_watchdog();
143} 145}
144EXPORT_SYMBOL(touch_nmi_watchdog); 146EXPORT_SYMBOL(touch_nmi_watchdog);
@@ -201,10 +203,9 @@ void watchdog_overflow_callback(struct perf_event *event, int nmi,
201 struct pt_regs *regs) 203 struct pt_regs *regs)
202{ 204{
203 int this_cpu = smp_processor_id(); 205 int this_cpu = smp_processor_id();
204 unsigned long touch_ts = per_cpu(watchdog_touch_ts, this_cpu);
205 206
206 if (touch_ts == 0) { 207 if (__get_cpu_var(watchdog_nmi_touch) == true) {
207 __touch_watchdog(); 208 __get_cpu_var(watchdog_nmi_touch) = false;
208 return; 209 return;
209 } 210 }
210 211