[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] NMI: Command line parameter for watchdog timeout



# HG changeset patch
# User Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
# Date 1331198607 0
# Node ID 2487f63339c00a91cf80c1a4598c10fdcaac0464
# Parent  322300fd2ebd7857b536531ccb79ceed5f799a36
NMI: Command line parameter for watchdog timeout

Introduce a command parameter to set the watchtog timeout.  Manually
specifying "watchdog_timeout=<seconds>" on the command line will also
turn the watchdog on.  For consistency, move opt_watchdog into nmi.c
along with opt_watchdog_timeout.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Committed-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 322300fd2ebd -r 2487f63339c0 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown       Thu Mar 08 09:17:21 2012 +0000
+++ b/docs/misc/xen-command-line.markdown       Thu Mar 08 09:23:27 2012 +0000
@@ -391,7 +391,17 @@
 ### watchdog
 > `= <boolean>`
 
-Run an NMI watchdog on each processor.  Defaults to disabled.
+> Default: `false`
+
+Run an NMI watchdog on each processor.  If a processor is stuck for longer 
than the watchdog\_timeout, a panic occurs.
+
+### watchdog\_timeout
+> `= <integer>`
+
+> Default: `5`
+
+Set the NMI watchdog timeout in seconds.  Specifying `0` will turn off the 
watchdog.
+
 ### x2apic
 ### x2apic\_phys
 ### xencons
diff -r 322300fd2ebd -r 2487f63339c0 xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c        Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/arch/x86/nmi.c        Thu Mar 08 09:23:27 2012 +0000
@@ -40,6 +40,19 @@
 static DEFINE_PER_CPU(struct timer, nmi_timer);
 static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks);
 
+/* opt_watchdog: If true, run a watchdog NMI on each processor. */
+bool_t __initdata opt_watchdog = 0;
+boolean_param("watchdog", opt_watchdog);
+
+/* opt_watchdog_timeout: Number of seconds to wait before panic. */
+static unsigned int opt_watchdog_timeout = 5;
+static void parse_watchdog_timeout(char * s)
+{
+    opt_watchdog_timeout = simple_strtoull(s, NULL, 0);
+    opt_watchdog = !!opt_watchdog_timeout;
+}
+custom_param("watchdog_timeout", parse_watchdog_timeout);
+
 /*
  * lapic_nmi_owner tracks the ownership of the lapic NMI hardware:
  * - it may be reserved by some other driver, or not
@@ -425,11 +438,11 @@
          !atomic_read(&watchdog_disable_count) )
     {
         /*
-         * Ayiee, looks like this CPU is stuck ... wait a few IRQs (5 seconds) 
+         * Ayiee, looks like this CPU is stuck ... wait for the timeout
          * before doing the oops ...
          */
         this_cpu(alert_counter)++;
-        if ( this_cpu(alert_counter) == 5*nmi_hz )
+        if ( this_cpu(alert_counter) == opt_watchdog_timeout*nmi_hz )
         {
             console_force_unlock();
             printk("Watchdog timer detects that CPU%d is stuck!\n",
diff -r 322300fd2ebd -r 2487f63339c0 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c      Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/arch/x86/setup.c      Thu Mar 08 09:23:27 2012 +0000
@@ -45,6 +45,7 @@
 #include <asm/mach-generic/mach_apic.h> /* for generic_apic_probe */
 #include <asm/setup.h>
 #include <xen/cpu.h>
+#include <asm/nmi.h>
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
@@ -54,10 +55,6 @@
 static unsigned int __initdata max_cpus;
 integer_param("maxcpus", max_cpus);
 
-/* opt_watchdog: If true, run a watchdog NMI on each processor. */
-static bool_t __initdata opt_watchdog;
-boolean_param("watchdog", opt_watchdog);
-
 /* smep: Enable/disable Supervisor Mode Execution Protection (default on). */
 static bool_t __initdata disable_smep;
 invbool_param("smep", disable_smep);
diff -r 322300fd2ebd -r 2487f63339c0 xen/include/asm-x86/nmi.h
--- a/xen/include/asm-x86/nmi.h Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/include/asm-x86/nmi.h Thu Mar 08 09:23:27 2012 +0000
@@ -5,6 +5,9 @@
 #include <public/nmi.h>
 
 struct cpu_user_regs;
+
+/* Watchdog boolean from the command line */
+extern bool_t opt_watchdog;
  
 typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
  

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.