accf68b91d8dbfc1709ffbf1da05c08087423239
[linux-flexiantxendom0-3.2.10.git] / Documentation / nmi_watchdog.txt
1
2 Is your ix86 system locking up unpredictably? No keyboard activity, just
3 a frustrating complete hard lockup? Do you want to help us debugging
4 such lockups? If all yes then this document is definitely for you.
5
6 On Intel and similar ix86 type hardware there is a feature that enables
7 us to generate 'watchdog NMI interrupts'.  (NMI: Non Maskable Interrupt
8 which get executed even if the system is otherwise locked up hard).
9 This can be used to debug hard kernel lockups.  By executing periodic
10 NMI interrupts, the kernel can monitor whether any CPU has locked up,
11 and print out debugging messages if so.  
12
13 In order to use the NMI watchdoc, you need to have APIC support in your
14 kernel. For SMP kernels, APIC support gets compiled in automatically. For
15 UP, enable either CONFIG_X86_UP_APIC (Processor type and features -> Local
16 APIC support on uniprocessors) or CONFIG_X86_UP_IOAPIC (Processor type and
17 features -> IO-APIC support on uniprocessors) in your kernel config.
18 CONFIG_X86_UP_APIC is for uniprocessor machines without an IO-APIC.
19 CONFIG_X86_UP_IOAPIC is for uniprocessor with an IO-APIC. [Note: certain
20 kernel debugging options, such as Kernel Stack Meter or Kernel Tracer,
21 may implicitly disable the NMI watchdog.]
22
23 To actually enable the NMI watchdog, use the 'nmi_watchdog=N' boot
24 parameter.  Eg. the relevant lilo.conf entry:
25
26         append="nmi_watchdog=1"
27
28 For SMP machines and UP machines with an IO-APIC use nmi_watchdog=1.
29 For UP machines without an IO-APIC use nmi_watchdog=2, this only works
30 for some processor types.  If in doubt, boot with nmi_watchdog=1 and
31 check the NMI count in /proc/interrupts; if the count is zero then
32 reboot with nmi_watchdog=2 and check the NMI count.  If it is still
33 zero then log a problem, you probably have a processor that needs to be
34 added to the nmi code.
35
36 A 'lockup' is the following scenario: if any CPU in the system does not
37 execute the period local timer interrupt for more than 5 seconds, then
38 the NMI handler generates an oops and kills the process. This
39 'controlled crash' (and the resulting kernel messages) can be used to
40 debug the lockup. Thus whenever the lockup happens, wait 5 seconds and
41 the oops will show up automatically. If the kernel produces no messages
42 then the system has crashed so hard (eg. hardware-wise) that either it
43 cannot even accept NMI interrupts, or the crash has made the kernel
44 unable to print messages.
45
46 NOTE: starting with 2.4.2-ac18 the NMI-oopser is disabled by default,
47 you have to enable it with a boot time parameter.  Prior to 2.4.2-ac18
48 the NMI-oopser is enabled unconditionally on x86 SMP boxes.
49
50 [ feel free to send bug reports, suggestions and patches to
51   Ingo Molnar <mingo@redhat.com> or the Linux SMP mailing
52   list at <linux-smp@vger.kernel.org> ]
53