[PATCH 8/8] [watchdog] separate touch_nmi_watchdog code path from touch_watchdog

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Don Zickus
Date: Friday, May 7, 2010 - 2:11 pm

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 belows 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>
---
 kernel/watchdog.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 80a282c..09fb804 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -31,6 +31,7 @@ int watchdog_enabled;
 int __read_mostly softlockup_thresh = 60;
 
 static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts);
+static DEFINE_PER_CPU(bool, watchdog_nmi_touch);
 static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog);
 static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer);
 static DEFINE_PER_CPU(bool, softlockup_touch_sync);
@@ -145,6 +146,7 @@ void touch_softlockup_watchdog_sync(void)
 
 void touch_nmi_watchdog(void)
 {
+	__get_cpu_var(watchdog_nmi_touch) = true;
 	touch_softlockup_watchdog();
 }
 EXPORT_SYMBOL(touch_nmi_watchdog);
@@ -201,10 +203,9 @@ void watchdog_overflow_callback(struct perf_event *event, int nmi,
 		 struct pt_regs *regs)
 {
 	int this_cpu = smp_processor_id();
-	unsigned long touch_ts = per_cpu(watchdog_touch_ts, this_cpu);
 
-	if (touch_ts == 0) {
-		__touch_watchdog();
+	if (__get_cpu_var(watchdog_nmi_touch) == true) {
+		__get_cpu_var(watchdog_nmi_touch) = false;
 		return;
 	}
 
-- 
1.7.0.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] lockup detector changes, Don Zickus, (Fri May 7, 2:11 pm)
[PATCH 3/8] [watchdog] remove old softlockup code, Don Zickus, (Fri May 7, 2:11 pm)
[PATCH 4/8] [watchdog] remove nmi_watchdog.c file, Don Zickus, (Fri May 7, 2:11 pm)
[PATCH 6/8] [x86] watchdog: cleanup hw_nmi.c cruft, Don Zickus, (Fri May 7, 2:11 pm)
[PATCH 8/8] [watchdog] separate touch_nmi_watchdog code pa ..., Don Zickus, (Fri May 7, 2:11 pm)
Re: [PATCH 1/8] [watchdog] combine nmi_watchdog and softlockup, Frederic Weisbecker, (Wed May 12, 12:55 pm)
Re: [PATCH 2/8] [nmi watchdog] touch_softlockup cleanups a ..., Frederic Weisbecker, (Wed May 12, 1:06 pm)
Re: [PATCH 2/8] [nmi watchdog] touch_softlockup cleanups a ..., Frederic Weisbecker, (Wed May 12, 1:28 pm)
Re: [PATCH 2/8] [nmi watchdog] touch_softlockup cleanups a ..., Frederic Weisbecker, (Wed May 12, 2:00 pm)
[tip:perf/nmi] lockup_detector: Combine nmi_watchdog and s ..., tip-bot for Don Zickus, (Wed May 12, 11:51 pm)
[tip:perf/nmi] lockup_detector: Touch_softlockup cleanups ..., tip-bot for Don Zickus, (Wed May 12, 11:52 pm)
[tip:perf/nmi] lockup_detector: Remove old softlockup code, tip-bot for Don Zickus, (Wed May 12, 11:52 pm)
[tip:perf/nmi] lockup_detector: Remove nmi_watchdog.c file, tip-bot for Don Zickus, (Wed May 12, 11:52 pm)
[tip:perf/nmi] x86: Move trigger_all_cpu_backtrace to its ..., tip-bot for Don Zickus, (Wed May 12, 11:53 pm)
[tip:perf/nmi] x86: Cleanup hw_nmi.c cruft, tip-bot for Don Zickus, (Wed May 12, 11:53 pm)
[tip:perf/nmi] lockup_detector: Separate touch_nmi_watchdo ..., tip-bot for Don Zickus, (Wed May 12, 11:53 pm)