Detect Hard and Soft Lockups

modulename: watchdog.ko

configname: CONFIG_LOCKUP_DETECTOR

Linux Kernel Configuration
└─>Debug Lockups and Hangs
└─>Detect Hard and Soft Lockups
In linux kernel since version 2.6.36 (release Date: 2010-10-20)  
Say Y here to enable the kernel to act as a watchdog to detect
hard and soft lockups.

Softlockups are bugs that cause the kernel to loop in kernel
mode for more than 20 seconds, without giving other tasks a
chance to run. The current stack trace is displayed upon
detection and the system will stay locked up.

Hardlockups are bugs that cause the CPU to loop in kernel mode
for more than 10 seconds, without letting other interrupts have a
chance to run. The current stack trace is displayed upon detection
and the system will stay locked up.

The overhead should be minimal. A periodic hrtimer runs to
generate interrupts and kick the watchdog task every 4 seconds.
An NMI is generated every 10 seconds or so to check for hardlockups.

The frequency of hrtimer and NMI events and the soft and hard lockup
thresholds can be controlled through the sysctl watchdog_thresh.

source code: