Commit 86f5e6a7 authored by Fernando Luis Vázquez Cao's avatar Fernando Luis Vázquez Cao Committed by Ingo Molnar

watchdog: Fix code/comments mismatches

Reflect the change in the soft and hard lockup thresholds and
their relation to the frequency of the hrtimer and NMI events in
the code comments. While at it, remove references to files that
do not exist anymore.
Signed-off-by: default avatarFernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
Link: http://lkml.kernel.org/r/1328827342-6253-3-git-send-email-dzickus@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5f329089
...@@ -3,12 +3,9 @@ ...@@ -3,12 +3,9 @@
* *
* started by Don Zickus, Copyright (C) 2010 Red Hat, Inc. * started by Don Zickus, Copyright (C) 2010 Red Hat, Inc.
* *
* this code detects hard lockups: incidents in where on a CPU * Note: Most of this code is borrowed heavily from the original softlockup
* the kernel does not respond to anything except NMI. * detector, so thanks to Ingo for the initial implementation.
* * Some chunks also taken from the old x86-specific nmi watchdog code, thanks
* Note: Most of this code is borrowed heavily from softlockup.c,
* so thanks to Ingo for the initial implementation.
* Some chunks also taken from arch/x86/kernel/apic/nmi.c, thanks
* to those contributors as well. * to those contributors as well.
*/ */
...@@ -117,9 +114,10 @@ static unsigned long get_sample_period(void) ...@@ -117,9 +114,10 @@ static unsigned long get_sample_period(void)
{ {
/* /*
* convert watchdog_thresh from seconds to ns * convert watchdog_thresh from seconds to ns
* the divide by 5 is to give hrtimer 5 chances to * the divide by 5 is to give hrtimer several chances (two
* increment before the hardlockup detector generates * or three with the current relation between the soft
* a warning * and hard thresholds) to increment before the
* hardlockup detector generates a warning
*/ */
return get_softlockup_thresh() * (NSEC_PER_SEC / 5); return get_softlockup_thresh() * (NSEC_PER_SEC / 5);
} }
...@@ -336,9 +334,11 @@ static int watchdog(void *unused) ...@@ -336,9 +334,11 @@ static int watchdog(void *unused)
set_current_state(TASK_INTERRUPTIBLE); set_current_state(TASK_INTERRUPTIBLE);
/* /*
* Run briefly once per second to reset the softlockup timestamp. * Run briefly (kicked by the hrtimer callback function) once every
* If this gets delayed for more than 60 seconds then the * get_sample_period() seconds (4 seconds by default) to reset the
* debug-printout triggers in watchdog_timer_fn(). * softlockup timestamp. If this gets delayed for more than
* 2*watchdog_thresh seconds then the debug-printout triggers in
* watchdog_timer_fn().
*/ */
while (!kthread_should_stop()) { while (!kthread_should_stop()) {
__touch_watchdog(); __touch_watchdog();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment