Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223917
b: refs/heads/master
c: 67b96c1
h: refs/heads/master
i:
  223915: 145d2b8
v: v3
  • Loading branch information
Ingo Molnar committed Dec 9, 2010
1 parent a14a146 commit b02197c
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ddbc24b72c2c3f3f0182bbc2cb70b31c52a6f45b
refs/heads/master: 67b96c182c36c83cd6881122b4a7922b2634047b
10 changes: 1 addition & 9 deletions trunk/Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1579,20 +1579,12 @@ and is between 256 and 4096 characters. It is defined in the file

nmi_watchdog= [KNL,BUGS=X86] Debugging features for SMP kernels
Format: [panic,][num]
Valid num: 0,1,2
Valid num: 0
0 - turn nmi_watchdog off
1 - use the IO-APIC timer for the NMI watchdog
2 - use the local APIC for the NMI watchdog using
a performance counter. Note: This will use one
performance counter and the local APIC's performance
vector.
When panic is specified, panic when an NMI watchdog
timeout occurs.
This is useful when you use a panic=... timeout and
need the box quickly up again.
Instead of 1 and 2 it is possible to use the following
symbolic names: lapic and ioapic
Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic

netpoll.carrier_timeout=
[NET] Specifies amount of time (in seconds) that
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ int __init init_hw_perf_events(void)

return 0;
}
early_initcall(init_hw_perf_event);
early_initcall(init_hw_perf_events);

void perf_callchain_kernel(struct perf_callchain_entry *entry,
struct pt_regs *regs)
Expand Down
11 changes: 7 additions & 4 deletions trunk/arch/x86/kernel/apic/hw_nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ u64 hw_nmi_get_sample_period(void)
}
#endif

#ifndef CONFIG_HARDLOCKUP_DETECTOR
void touch_nmi_watchdog(void)
{
touch_softlockup_watchdog();
}
EXPORT_SYMBOL(touch_nmi_watchdog);
#endif
#ifdef arch_trigger_all_cpu_backtrace

/* For reliability, we're prepared to waste bits here. */
static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly;

Expand Down Expand Up @@ -93,6 +99,3 @@ static int __init register_trigger_all_cpu_backtrace(void)
}
early_initcall(register_trigger_all_cpu_backtrace);
#endif

/* STUB calls to mimic old nmi_watchdog behaviour */
int unknown_nmi_panic;
16 changes: 11 additions & 5 deletions trunk/arch/x86/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ EXPORT_SYMBOL_GPL(used_vectors);

static int ignore_nmis;

int unknown_nmi_panic;

static inline void conditional_sti(struct pt_regs *regs)
{
if (regs->flags & X86_EFLAGS_IF)
Expand Down Expand Up @@ -300,6 +302,13 @@ do_general_protection(struct pt_regs *regs, long error_code)
die("general protection fault", regs, error_code);
}

static int __init setup_unknown_nmi_panic(char *str)
{
unknown_nmi_panic = 1;
return 1;
}
__setup("unknown_nmi_panic", setup_unknown_nmi_panic);

static notrace __kprobes void
mem_parity_error(unsigned char reason, struct pt_regs *regs)
{
Expand Down Expand Up @@ -371,7 +380,7 @@ unknown_nmi_error(unsigned char reason, struct pt_regs *regs)
reason, smp_processor_id());

printk(KERN_EMERG "Do you have a strange power saving mode enabled?\n");
if (panic_on_unrecovered_nmi)
if (unknown_nmi_panic || panic_on_unrecovered_nmi)
panic("NMI: Not continuing");

printk(KERN_EMERG "Dazed and confused, but trying to continue\n");
Expand All @@ -397,11 +406,8 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)
if (notify_die(DIE_NMI, "nmi", regs, reason, 2, SIGINT)
== NOTIFY_STOP)
return;

unknown_nmi_error(reason, regs);
#else
unknown_nmi_error(reason, regs);
#endif
unknown_nmi_error(reason, regs);

return;
}
Expand Down
4 changes: 3 additions & 1 deletion trunk/include/linux/nmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
*/
#ifdef ARCH_HAS_NMI_WATCHDOG
#include <asm/nmi.h>
#endif
extern void touch_nmi_watchdog(void);
#else
#ifndef CONFIG_HARDLOCKUP_DETECTOR
static inline void touch_nmi_watchdog(void)
{
Expand All @@ -25,6 +26,7 @@ static inline void touch_nmi_watchdog(void)
#else
extern void touch_nmi_watchdog(void);
#endif
#endif

/*
* Create trigger_all_cpu_backtrace() out of the arch-provided
Expand Down
16 changes: 16 additions & 0 deletions trunk/kernel/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,22 @@ static struct ctl_table kern_table[] = {
.extra1 = &zero,
.extra2 = &one,
},
{
.procname = "nmi_watchdog",
.data = &watchdog_enabled,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = proc_dowatchdog_enabled,
},
#endif
#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
{
.procname = "unknown_nmi_panic",
.data = &unknown_nmi_panic,
.maxlen = sizeof (int),
.mode = 0644,
.proc_handler = proc_dointvec,
},
#endif
#if defined(CONFIG_X86)
{
Expand Down
1 change: 0 additions & 1 deletion trunk/kernel/sysctl_binary.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ static const struct bin_table bin_kern_table[] = {
{ CTL_INT, KERN_IA64_UNALIGNED, "ignore-unaligned-usertrap" },
{ CTL_INT, KERN_COMPAT_LOG, "compat-log" },
{ CTL_INT, KERN_MAX_LOCK_DEPTH, "max_lock_depth" },
{ CTL_INT, KERN_NMI_WATCHDOG, "nmi_watchdog" },
{ CTL_INT, KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" },
{}
};
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ static int __init hardlockup_panic_setup(char *str)
{
if (!strncmp(str, "panic", 5))
hardlockup_panic = 1;
else if (!strncmp(str, "0", 1))
no_watchdog = 1;
return 1;
}
__setup("nmi_watchdog=", hardlockup_panic_setup);
Expand Down

0 comments on commit b02197c

Please sign in to comment.