Skip to contentSkip to conversation

hangcheck-timer

PATCH In review Joel Becker 2 participants 3 messages Jan 16, 2003 – Jan 17, 2003 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hangcheck-timer

Folks,
Attached is a patch adding hangcheck-timer. It is used to detect
when the system goes out to lunch for a period of time, and then returns. This is interesting for debugging drivers as well as for clustering environments.
The module sets a timer. When the timer goes off, it then uses
get_cycles() to determine how much real time has passed.
On a normal system, the real elapsed time will be almost
identical to the expected timer duration. However, if a device decided to udelay for 60 seconds (or some other circumstance), the module takes notice. If the margin of error passes a threshold, the driver prints a warning or the machine is rebooted.
There are three parameters.

hangcheck_tick - Timer duration
hangcheck_margin - Allowed margin of between elapsed
jiffies and elapsed wall clock
hangcheck_reboot - If nonzero, reboot if margin
exceeded.

When compiled statically, s/hangcheck/hcheck/ for the kernel
command line.
Marcelo, please apply.

Joel

drivers/char/Config.in +2 -0
diff -uNr linux-2.4.20/drivers/char/Config.in linux-2.4.20-hangcheck/drivers/char/Config.in
@@ -321,4 +321,6 @@
    tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
 fi
 
+tristate 'Hangcheck Timer (kernel pause detection)' CONFIG_HANGCHECK_TIMER
+
 endmenu
drivers/char/Makefile +1 -0
diff -uNr linux-2.4.20/drivers/char/Makefile linux-2.4.20-hangcheck/drivers/char/Makefile
@@ -283,6 +283,7 @@
 obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o
 obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o
 obj-$(CONFIG_AMD7XX_TCO) += amd7xx_tco.o
+obj-$(CONFIG_HANGCHECK_TIMER) += hangcheck-timer.o
 
 subdir-$(CONFIG_MWAVE) += mwave
 ifeq ($(CONFIG_MWAVE),y)
drivers/char/hangcheck-timer.c +173 -0

173 lines not on this page · raw message

Signature · 13 lines
"Friends may come and go, but enemies accumulate." 
        - Thomas Jones

Joel Becker
Senior Member of Technical Staff
Oracle Corporation
E-mail: [email protected]
Phone: (650) 506-8127
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#1 lore raw
Quoted 5 lines · Joel Becker

Folks,
Attached is a patch adding hangcheck-timer. It is used to detect
when the system goes out to lunch for a period of time, and then returns. This is interesting for debugging drivers as well as for clustering environments.

Quoted 8 lines

The module sets a timer. When the timer goes off, it then uses
get_cycles() to determine how much real time has passed.
On a normal system, the real elapsed time will be almost
identical to the expected timer duration. However, if a device decided to udelay for 60 seconds (or some other circumstance), the module takes notice. If the margin of error passes a threshold, the driver prints a warning or the machine is rebooted.
There are three parameters.

NMI watchdog? Doesn't look like this can catch cases where you have interrupts disabled and spinning on a lock, if you manage to run this code then the box isn't really locked up. In which case the software watchdog should be as good as this.

Zwane

Signature · 1 line
function.linuxpower.ca
#2 lore raw
Quoted 4 lines · Zwane Mwaikambo

NMI watchdog? Doesn't look like this can catch cases where you have interrupts disabled and spinning on a lock, if you manage to run this code then the box isn't really locked up. In which case the software watchdog should be as good as this.

Please read again. This isn't about catching a complete lockup.
This is about catching a pause and resume that jiffies does not notice.

Joel

Signature · 9 lines
Life's Little Instruction Book #15

	"Own a great stereo system."

Joel Becker
Senior Member of Technical Staff
Oracle Corporation
E-mail: [email protected]
Phone: (650) 506-8127