Unified lockup detector
Subsystems (5)
Ingo,
Please pull the perf/nmi branch that can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
perf/nmi
There is also a merge of v2.6.34-rc7 to catch up with latest softlockup changes and prevent from conflicts.
Thanks,
Frederic
---
Don Zickus (7):
lockup_detector: Combine nmi_watchdog and softlockup detector
lockup_detector: Touch_softlockup cleanups and softlockup_tick removal
lockup_detector: Remove old softlockup code
lockup_detector: Remove nmi_watchdog.c file
x86: Move trigger_all_cpu_backtrace to its own die_notifier
x86: Cleanup hw_nmi.c cruft
lockup_detector: Separate touch_nmi_watchdog code path from touch_watchdog
Frederic Weisbecker (2):
lockup_detector: Make BOOTPARAM_SOFTLOCKUP_PANIC depend on LOCKUP_DETECTOR
lockup_detector: Fix forgotten config conversion
Documentation/kernel-parameters.txt | 2 + arch/x86/include/asm/nmi.h | 2 +- arch/x86/kernel/apic/Makefile | 4 +- arch/x86/kernel/apic/hw_nmi.c | 119 +++----- arch/x86/kernel/traps.c | 4 +- include/linux/nmi.h | 8 +- include/linux/sched.h | 12 +- init/Kconfig | 5 +- kernel/Makefile | 3 +- kernel/nmi_watchdog.c | 259 ---------------- kernel/softlockup.c | 293 ------------------ kernel/sysctl.c | 52 ++-- kernel/timer.c | 1 - kernel/watchdog.c | 564 +++++++++++++++++++++++++++++++++++ lib/Kconfig.debug | 32 ++- 15 files changed, 679 insertions(+), 681 deletions(-)
PATCH 1/9 lockup_detector: Combine nmi_watchdog and softlockup detector
From: Don Zickus <[email protected]>
The new nmi_watchdog (which uses the perf event subsystem) is very similar in structure to the softlockup detector. Using Ingo's suggestion, I combined the two functionalities into one file:kernel/watchdog.c.
Now both the nmi_watchdog (or hardlockup detector) and softlockup detector sit on top of the perf event subsystem, which is run every 60 seconds or so to see if there are any lockups.
To detect hardlockups, cpus not responding to interrupts, I implemented an hrtimer that runs 5 times for every perf event overflow event. If that stops counting on a cpu, then the cpu is most likely in trouble.
To detect softlockups, tasks not yielding to the scheduler, I used the previous kthread idea that now gets kicked every time the hrtimer fires. If the kthread isn't being scheduled neither is anyone else and the warning is printed to the console.
I tested this on x86_64 and both the softlockup and hardlockup paths work.
V2:
- cleaned up the Kconfig and softlockup combination
- surrounded hardlockup cases with #ifdef CONFIG_PERF_EVENTS_NMI
- seperated out the softlockup case from perf event subsystem
- re-arranged the enabling/disabling nmi watchdog from proc space
- added cpumasks for hardlockup failure cases
- removed fallback to soft events if no PMU exists for hard events
V3:
- comment cleanups
- drop support for older softlockup code
- per_cpu cleanups
- completely remove software clock base hardlockup detector
- use per_cpu masking on hard/soft lockup detection
- #ifdef cleanups
- rename config option NMI_WATCHDOG to LOCKUP_DETECTOR
- documentation additions
V4:
- documentation fixes
- convert per_cpu to __get_cpu_var
- powerpc compile fixes
V5:
- split apart warn flags for hard and soft lockups
TODO:
- figure out how to make an arch-agnostic clock2cycles call (if possible) to feed into perf events as a sample period
[fweisbec: merged conflict patch]
LKML-Reference: <[email protected]>
--- Documentation/kernel-parameters.txt | 2 + arch/x86/include/asm/nmi.h | 2 +- arch/x86/kernel/apic/Makefile | 4 +- arch/x86/kernel/apic/hw_nmi.c | 2 +- arch/x86/kernel/traps.c | 4 +- include/linux/nmi.h | 8 +- include/linux/sched.h | 6 + init/Kconfig | 5 +- kernel/Makefile | 3 +- kernel/sysctl.c | 21 +- kernel/watchdog.c | 592 +++++++++++++++++++++++++++++++++++ lib/Kconfig.debug | 30 ++- 12 files changed, 650 insertions(+), 29 deletions(-) create mode 100644 kernel/watchdog.c
Documentation/kernel-parameters.txt +2 -0
@@ -1777,6 +1777,8 @@ and is between 256 and 4096 characters. It is defined in the file nousb [USB] Disable the USB subsystem + nowatchdog [KNL] Disable the lockup detector. + nowb [ARM] nox2apic [X86-64,APIC] Do not enable x2APIC mode.
arch/x86/include/asm/nmi.h +1 -1
@@ -17,7 +17,7 @@ int do_nmi_callback(struct pt_regs *regs, int cpu);extern void die_nmi (char *str,struct pt_regs *regs,int do_panic);extern int check_nmi_watchdog (void ); -#if !defined(CONFIG_NMI_WATCHDOG ) +#if !defined(CONFIG_LOCKUP_DETECTOR )extern int nmi_watchdog_enabled;#endif extern int avail_to_resrv_perfctr_nmi_bit (unsigned int );
arch/x86/kernel/apic/Makefile +2 -2
@@ -3,10 +3,10 @@ # obj-$(CONFIG_X86_LOCAL_APIC) += apic.o apic_noop.o probe_$(BITS).o ipi.o -ifneq ($(CONFIG_NMI_WATCHDOG),y) +ifneq ($(CONFIG_LOCKUP_DETECTOR),y) obj-$(CONFIG_X86_LOCAL_APIC) += nmi.o endif -obj-$(CONFIG_NMI_WATCHDOG) += hw_nmi.o +obj-$(CONFIG_LOCKUP_DETECTOR) += hw_nmi.o obj-$(CONFIG_X86_IO_APIC) += io_apic.o obj-$(CONFIG_SMP) += ipi.o
arch/x86/kernel/apic/hw_nmi.c +1 -1
@@ -89,7 +89,7 @@ int hw_nmi_is_cpu_stuck(struct pt_regs *regs)u64 hw_nmi_get_sample_period (void ) { -return cpu_khz *1000 ; +return (u64)(cpu_khz) *1000 *60 ; }#ifdef ARCH_HAS_NMI_WATCHDOG
arch/x86/kernel/traps.c +2 -2
@@ -406,7 +406,7 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs) == NOTIFY_STOP)return ; -#ifndef CONFIG_NMI_WATCHDOG +#ifndef CONFIG_LOCKUP_DETECTOR /* * Ok, so this is none of the documented NMI sources, * so it must be the NMI watchdog.
@@ -414,7 +414,7 @@ static notrace __kprobes void default_do_nmi(struct pt_regs *regs)if (nmi_watchdog_tick (regs, reason))return ; if (!do_nmi_callback(regs, cpu)) -#endif /* !CONFIG_NMI_WATCHDOG */ +#endif /* !CONFIG_LOCKUP_DETECTOR */ unknown_nmi_error (reason, regs);#else unknown_nmi_error (reason, regs);
include/linux/nmi.h +4 -4
@@ -20,7 +20,7 @@ extern void touch_nmi_watchdog(void); extern void acpi_nmi_disable(void); extern void acpi_nmi_enable(void); #else -#ifndef CONFIG_NMI_WATCHDOG +#ifndef CONFIG_LOCKUP_DETECTOR static inline void touch_nmi_watchdog(void) { touch_softlockup_watchdog();
@@ -51,12 +51,12 @@ static inline bool trigger_all_cpu_backtrace(void) }#endif -#ifdef CONFIG_NMI_WATCHDOG +#ifdef CONFIG_LOCKUP_DETECTOR int hw_nmi_is_cpu_stuck (struct pt_regs *);u64 hw_nmi_get_sample_period (void ); -extern int nmi_watchdog_enabled; +extern int watchdog_enabled;struct ctl_table ; -extern int proc_nmi_enabled (struct ctl_table *,int , +extern int proc_dowatchdog_enabled (struct ctl_table *,int ,void __user *,size_t *,loff_t *);#endif
include/linux/sched.h +6 -0
@@ -346,6 +346,12 @@ extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, size_t *lenp, loff_t *ppos);#endif +#ifdef CONFIG_LOCKUP_DETECTOR +extern int proc_dowatchdog_thresh (struct ctl_table *table,int write, +void __user *buffer, +size_t *lenp,loff_t *ppos); +#endif +/* Attach to any functions which should be ignored in wchan output. */ #define __sched __attribute__((__section__(".sched.text")))
init/Kconfig +4 -1
@@ -944,8 +944,11 @@ config PERF_USE_VMALLOC config PERF_EVENTS_NMI bool + depends on PERF_EVENTS help - Arch has support for nmi_watchdog + System hardware can generate an NMI using the perf event + subsystem. Also has support for calculating CPU cycle events + to determine how many clock cycles in a given period. menu "Kernel Performance Events And Counters"
kernel/Makefile +1 -2
@@ -76,9 +76,8 @@ obj-$(CONFIG_GCOV_KERNEL) += gcov/ obj-$(CONFIG_AUDIT_TREE) += audit_tree.o obj-$(CONFIG_KPROBES) += kprobes.o obj-$(CONFIG_KGDB) += kgdb.o -obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o -obj-$(CONFIG_NMI_WATCHDOG) += nmi_watchdog.o obj-$(CONFIG_DETECT_HUNG_TASK) += hung_task.o +obj-$(CONFIG_LOCKUP_DETECTOR) += watchdog.o obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
kernel/sysctl.c +15 -6
@@ -74,7 +74,7 @@#include <scsi/sg.h> #endif -#ifdef CONFIG_NMI_WATCHDOG +#ifdef CONFIG_LOCKUP_DETECTOR #include <linux/nmi.h> #endif
@@ -686,16 +686,25 @@ static struct ctl_table kern_table[] = { .mode = 0444, .proc_handler = proc_dointvec, }, -#if defined(CONFIG_NMI_WATCHDOG) +#if defined(CONFIG_LOCKUP_DETECTOR) { - .procname = "nmi_watchdog", - .data = &nmi_watchdog_enabled, + .procname = "watchdog", + .data = &watchdog_enabled, .maxlen = sizeof (int), .mode = 0644, - .proc_handler = proc_nmi_enabled, + .proc_handler = proc_dowatchdog_enabled, + }, + { + .procname = "watchdog_thresh", + .data = &softlockup_thresh, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dowatchdog_thresh, + .extra1 = &neg_one, + .extra2 = &sixty, }, #endif -#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) && !defined(CONFIG_NMI_WATCHDOG) +#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) && !defined(CONFIG_LOCKUP_DETECTOR) { .procname = "unknown_nmi_panic", .data = &unknown_nmi_panic,
kernel/watchdog.c new file +592 -0
592 lines not on this page · raw message
lib/Kconfig.debug +20 -10
@@ -153,7 +153,7 @@ config DEBUG_SHIRQ points; some don't and need to be caught. config DETECT_SOFTLOCKUP - bool "Detect Soft Lockups" + bool depends on DEBUG_KERNEL && !S390 default y help
@@ -171,17 +171,27 @@ config DETECT_SOFTLOCKUP can be detected via the NMI-watchdog, on platforms that support it.) -config NMI_WATCHDOG - bool "Detect Hard Lockups with an NMI Watchdog" - depends on DEBUG_KERNEL && PERF_EVENTS && PERF_EVENTS_NMI +config LOCKUP_DETECTOR + bool "Detect Hard and Soft Lockups" + depends on DEBUG_KERNEL + default DETECT_SOFTLOCKUP help - Say Y here to enable the kernel to use the NMI as a watchdog - to detect hard lockups. This is useful when a cpu hangs for no - reason but can still respond to NMIs. A backtrace is displayed - for reviewing and reporting. + 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 60 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 60 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, just an extra NMI every few - seconds. + The overhead should be minimal. A periodic hrtimer runs to + generate interrupts and kick the watchdog task every 10-12 seconds. + An NMI is generated every 60 seconds or so to check for hardlockups. config BOOTPARAM_SOFTLOCKUP_PANIC bool "Panic (Reboot) On Soft Lockups"
Signature · 1 line
1.6.2.3
PATCH 2/9 lockup_detector: Touch_softlockup cleanups and softlockup_tick removal
In reply to Frederic WeisbeckerFrom: Don Zickus <[email protected]>
Just some code cleanup to make touch_softlockup clearer and remove the softlockup_tick function as it is no longer needed.
Also remove the /proc softlockup_thres call as it has been changed to watchdog_thres.
LKML-Reference: <[email protected]>
--- include/linux/sched.h | 16 +++------------- kernel/sysctl.c | 9 --------- kernel/timer.c | 1 - kernel/watchdog.c | 35 +++-------------------------------- 4 files changed, 6 insertions(+), 55 deletions(-)
include/linux/sched.h +3 -13
@@ -312,19 +312,15 @@ extern void scheduler_tick(void);extern void sched_show_task (struct task_struct *p);#ifdef CONFIG_DETECT_SOFTLOCKUP -extern void softlockup_tick (void );extern void touch_softlockup_watchdog (void );extern void touch_softlockup_watchdog_sync (void );extern void touch_all_softlockup_watchdogs (void ); -extern int proc_dosoftlockup_thresh (struct ctl_table *table,int write, -void __user *buffer, -size_t *lenp,loff_t *ppos); +extern int proc_dowatchdog_thresh (struct ctl_table *table,int write, +void __user *buffer, +size_t *lenp,loff_t *ppos);extern unsigned int softlockup_panic;extern int softlockup_thresh;#else -static inline void softlockup_tick (void ) -{ -}static inline void touch_softlockup_watchdog (void ) { }
@@ -346,12 +342,6 @@ extern int proc_dohung_task_timeout_secs(struct ctl_table *table, int write, size_t *lenp, loff_t *ppos);#endif -#ifdef CONFIG_LOCKUP_DETECTOR -extern int proc_dowatchdog_thresh (struct ctl_table *table,int write, -void __user *buffer, -size_t *lenp,loff_t *ppos); -#endif -/* Attach to any functions which should be ignored in wchan output. */ #define __sched __attribute__((__section__(".sched.text")))
kernel/sysctl.c +0 -9
@@ -817,15 +817,6 @@ static struct ctl_table kern_table[] = { .extra1 = &zero, .extra2 = &one, }, - { - .procname = "softlockup_thresh", - .data = &softlockup_thresh, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dosoftlockup_thresh, - .extra1 = &neg_one, - .extra2 = &sixty, - },#endif #ifdef CONFIG_DETECT_HUNG_TASK {
kernel/timer.c +0 -1
@@ -1225,7 +1225,6 @@ void run_local_timers(void) {hrtimer_run_queues ();raise_softirq (TIMER_SOFTIRQ ); -softlockup_tick (); }/*
kernel/watchdog.c +3 -32
@@ -119,13 +119,12 @@ static void __touch_watchdog(void)__get_cpu_var (watchdog_touch_ts) =get_timestamp (this_cpu); } -void touch_watchdog (void ) +void touch_softlockup_watchdog (void ) {__get_cpu_var (watchdog_touch_ts) =0 ; } -EXPORT_SYMBOL (touch_watchdog); -void touch_all_watchdog (void ) +void touch_all_softlockup_watchdogs (void ) {int cpu;
@@ -140,35 +139,16 @@ void touch_all_watchdog(void)void touch_nmi_watchdog (void ) { -touch_watchdog (); +touch_softlockup_watchdog (); }EXPORT_SYMBOL (touch_nmi_watchdog); -void touch_all_nmi_watchdog (void ) -{ -touch_all_watchdog (); -} - -void touch_softlockup_watchdog (void ) -{ -touch_watchdog (); -} - -void touch_all_softlockup_watchdogs (void ) -{ -touch_all_watchdog (); -} -void touch_softlockup_watchdog_sync (void ) {__raw_get_cpu_var (softlockup_touch_sync) = true;__raw_get_cpu_var (watchdog_touch_ts) =0 ; } -void softlockup_tick (void ) -{ -} -#ifdef CONFIG_PERF_EVENTS_NMI /* watchdog detector functions */ static int is_hardlockup (int cpu)
@@ -522,15 +502,6 @@ int proc_dowatchdog_thresh(struct ctl_table *table, int write, {return proc_dointvec_minmax (table, write, buffer, lenp, ppos); } - -/* stub functions */ -int proc_dosoftlockup_thresh (struct ctl_table *table,int write, -void __user *buffer, -size_t *lenp,loff_t *ppos) -{ -return proc_dowatchdog_thresh (table, write, buffer, lenp, ppos); -} -/* end of stub functions */ #endif /* CONFIG_SYSCTL */
Signature · 1 line
1.6.2.3
PATCH 3/9 lockup_detector: Remove old softlockup code
In reply to Frederic WeisbeckerFrom: Don Zickus <[email protected]>
Now that is no longer compiled or used, just remove it.
Also move some of the code wrapped with DETECT_SOFTLOCKUP to the LOCKUP_DETECTOR wrappers because that is the code that uses it now.
LKML-Reference: <[email protected]>
--- kernel/softlockup.c | 293 --------------------------------------------------- kernel/sysctl.c | 22 ++-- 2 files changed, 10 insertions(+), 305 deletions(-) delete mode 100644 kernel/softlockup.c
kernel/softlockup.c deleted +0 -293
@@ -1,293 +0,0 @@ -/* -* Detect Soft Lockups -* -* started by Ingo Molnar, Copyright (C) 2005, 2006 Red Hat, Inc. -* -* this code detects soft lockups: incidents in where on a CPU -* the kernel does not reschedule for 10 seconds or more. -*/ -#include <linux/mm.h> -#include <linux/cpu.h> -#include <linux/nmi.h> -#include <linux/init.h> -#include <linux/delay.h> -#include <linux/freezer.h> -#include <linux/kthread.h> -#include <linux/lockdep.h> -#include <linux/notifier.h> -#include <linux/module.h> -#include <linux/sysctl.h> - -#include <asm/irq_regs.h> - -static DEFINE_SPINLOCK (print_lock); - -static DEFINE_PER_CPU(unsigned long, softlockup_touch_ts); /* touch timestamp */ -static DEFINE_PER_CPU(unsigned long, softlockup_print_ts); /* print timestamp */ -static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog); -static DEFINE_PER_CPU(bool, softlock_touch_sync); - -static int __read_mostly did_panic; -int __read_mostly softlockup_thresh =60 ; - -/* -* Should we panic (and reboot, if panic_timeout= is set) when a -* soft-lockup occurs: -*/ -unsigned int __read_mostly softlockup_panic = -CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE ; - -static int __init softlockup_panic_setup (char *str) -{ - softlockup_panic =simple_strtoul (str,NULL ,0 ); - -return 1 ; -} -__setup ("softlockup_panic=" , softlockup_panic_setup); - -static int -softlock_panic (struct notifier_block *this,unsigned long event,void *ptr) -{ - did_panic =1 ; - -return NOTIFY_DONE ; -} - -static struct notifier_block panic_block = { - .notifier_call = softlock_panic, -}; - -/* -* Returns seconds, approximately. We don't need nanosecond -* resolution, and we don't need to waste time with a big divide when -* 2^30ns == 1.074s. -*/ -static unsigned long get_timestamp (int this_cpu) -{ -return cpu_clock (this_cpu) >>30LL ;/* 2^30 ~= 10^9 */ -} - -static void __touch_softlockup_watchdog (void ) -{ -int this_cpu =raw_smp_processor_id (); - -__raw_get_cpu_var (softlockup_touch_ts) =get_timestamp (this_cpu); -} - -void touch_softlockup_watchdog (void ) -{ -__raw_get_cpu_var (softlockup_touch_ts) =0 ; -} -EXPORT_SYMBOL (touch_softlockup_watchdog); - -void touch_softlockup_watchdog_sync (void ) -{ -__raw_get_cpu_var (softlock_touch_sync) = true; -__raw_get_cpu_var (softlockup_touch_ts) =0 ; -} - -void touch_all_softlockup_watchdogs (void ) -{ -int cpu; - -/* Cause each CPU to re-update its timestamp rather than complain */ -for_each_online_cpu (cpu) -per_cpu (softlockup_touch_ts, cpu) =0 ; -} -EXPORT_SYMBOL (touch_all_softlockup_watchdogs); - -int proc_dosoftlockup_thresh (struct ctl_table *table,int write, -void __user *buffer, -size_t *lenp,loff_t *ppos) -{ -touch_all_softlockup_watchdogs (); -return proc_dointvec_minmax (table, write, buffer, lenp, ppos); -} - -/* -* This callback runs from the timer interrupt, and checks -* whether the watchdog thread has hung or not: -*/ -void softlockup_tick (void ) -{ -int this_cpu =smp_processor_id (); -unsigned long touch_ts =per_cpu (softlockup_touch_ts, this_cpu); -unsigned long print_ts; -struct pt_regs *regs =get_irq_regs (); -unsigned long now; - -/* Is detection switched off? */ -if (!per_cpu (softlockup_watchdog, this_cpu) || softlockup_thresh <=0 ) { -/* Be sure we don't false trigger if switched back on */ -if (touch_ts) -per_cpu (softlockup_touch_ts, this_cpu) =0 ; -return ; - } - -if (touch_ts ==0 ) { -if (unlikely (per_cpu (softlock_touch_sync, this_cpu))) { -/* -* If the time stamp was touched atomically -* make sure the scheduler tick is up to date. -*/ -per_cpu (softlock_touch_sync, this_cpu) = false; -sched_clock_tick (); - } -__touch_softlockup_watchdog (); -return ; - } - - print_ts =per_cpu (softlockup_print_ts, this_cpu); - -/* report at most once a second */ -if (print_ts == touch_ts || did_panic) -return ; - -/* do not print during early bootup: */ -if (unlikely (system_state !=SYSTEM_RUNNING )) { -__touch_softlockup_watchdog (); -return ; - } - - now =get_timestamp (this_cpu); - -/* -* Wake up the high-prio watchdog task twice per -* threshold timespan. -*/ -if (time_after (now - softlockup_thresh/2 , touch_ts)) -wake_up_process (per_cpu (softlockup_watchdog, this_cpu)); - -/* Warn about unreasonable delays: */ -if (time_before_eq (now - softlockup_thresh, touch_ts)) -return ; - -per_cpu (softlockup_print_ts, this_cpu) = touch_ts; - -spin_lock (&print_lock); -printk (KERN_ERR "BUG: soft lockup - CPU#%d stuck for %lus! [%s:%d]\n" , - this_cpu, now - touch_ts, - current->comm,task_pid_nr (current)); -print_modules (); -print_irqtrace_events (current); -if (regs) -show_regs (regs); -else -dump_stack (); -spin_unlock (&print_lock); - -if (softlockup_panic) -panic ("softlockup: hung tasks" ); -} - -/* -* The watchdog thread - runs every second and touches the timestamp. -*/ -static int watchdog (void *__bind_cpu) -{ -struct sched_param param = { .sched_priority =MAX_RT_PRIO -1 }; - -sched_setscheduler (current,SCHED_FIFO , ¶m); - -/* initialize timestamp */ -__touch_softlockup_watchdog (); - -set_current_state (TASK_INTERRUPTIBLE ); -/* -* Run briefly once per second to reset the softlockup timestamp. -* If this gets delayed for more than 60 seconds then the -* debug-printout triggers in softlockup_tick(). -*/ -while (!kthread_should_stop ()) { -__touch_softlockup_watchdog (); -schedule (); - -if (kthread_should_stop ()) -break ; - -set_current_state (TASK_INTERRUPTIBLE ); - } -__set_current_state (TASK_RUNNING ); - -return 0 ; -} - -/* -* Create/destroy watchdog threads as CPUs come and go: -*/ -static int __cpuinit -cpu_callback (struct notifier_block *nfb,unsigned long action,void *hcpu) -{ -int hotcpu = (unsigned long )hcpu; -struct task_struct *p; - -switch (action) { -case CPU_UP_PREPARE : -case CPU_UP_PREPARE_FROZEN : -BUG_ON (per_cpu (softlockup_watchdog, hotcpu)); - p =kthread_create (watchdog, hcpu,"watchdog/%d" , hotcpu); -if (IS_ERR (p)) { -printk (KERN_ERR "watchdog for %i failed\n" , hotcpu); -return NOTIFY_BAD ; - } -per_cpu (softlockup_touch_ts, hotcpu) =0 ; -per_cpu (softlockup_watchdog, hotcpu) = p; -kthread_bind (p, hotcpu); -break ; -case CPU_ONLINE : -case CPU_ONLINE_FROZEN : -wake_up_process (per_cpu (softlockup_watchdog, hotcpu)); -break ; -#ifdef CONFIG_HOTPLUG_CPU -case CPU_UP_CANCELED : -case CPU_UP_CANCELED_FROZEN : -if (!per_cpu (softlockup_watchdog, hotcpu)) -break ; -/* Unbind so it can run. Fall thru. */ -kthread_bind (per_cpu (softlockup_watchdog, hotcpu), -cpumask_any (cpu_online_mask)); -case CPU_DEAD : -case CPU_DEAD_FROZEN : - p =per_cpu (softlockup_watchdog, hotcpu); -per_cpu (softlockup_watchdog, hotcpu) =NULL ; -kthread_stop (p); -break ; -#endif /* CONFIG_HOTPLUG_CPU */ - } -return NOTIFY_OK ; -} - -static struct notifier_block __cpuinitdata cpu_nfb = { - .notifier_call = cpu_callback -}; - -static int __initdata nosoftlockup; - -static int __init nosoftlockup_setup (char *str) -{ - nosoftlockup =1 ; -return 1 ; -} -__setup ("nosoftlockup" , nosoftlockup_setup); - -static int __init spawn_softlockup_task (void ) -{ -void *cpu = (void *)(long )smp_processor_id (); -int err; - -if (nosoftlockup) -return 0 ; - - err =cpu_callback (&cpu_nfb,CPU_UP_PREPARE , cpu); -if (err ==NOTIFY_BAD ) { -BUG (); -return 1 ; - } -cpu_callback (&cpu_nfb,CPU_ONLINE , cpu); -register_cpu_notifier (&cpu_nfb); - -atomic_notifier_chain_register (&panic_notifier_list, &panic_block); - -return 0 ; -} -early_initcall (spawn_softlockup_task);
kernel/sysctl.c +10 -12
@@ -108,7 +108,7 @@ extern int blk_iopoll_enabled;#endif /* Constants used for minimum and maximum */ -#ifdef CONFIG_DETECT_SOFTLOCKUP +#ifdef CONFIG_LOCKUP_DETECTOR static int sixty =60 ;static int neg_one =-1 ;#endif
@@ -703,6 +703,15 @@ static struct ctl_table kern_table[] = { .extra1 = &neg_one, .extra2 = &sixty, }, + { + .procname = "softlockup_panic", + .data = &softlockup_panic, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = &zero, + .extra2 = &one, + },#endif #if defined(CONFIG_X86_LOCAL_APIC ) && defined(CONFIG_X86 ) && !defined(CONFIG_LOCKUP_DETECTOR ) {
@@ -807,17 +816,6 @@ static struct ctl_table kern_table[] = { .proc_handler = proc_dointvec, },#endif -#ifdef CONFIG_DETECT_SOFTLOCKUP - { - .procname = "softlockup_panic", - .data = &softlockup_panic, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = &zero, - .extra2 = &one, - }, -#endif#ifdef CONFIG_DETECT_HUNG_TASK { .procname = "hung_task_panic",
Signature · 1 line
1.6.2.3
PATCH 4/9 lockup_detector: Remove nmi_watchdog.c file
In reply to Frederic WeisbeckerFrom: Don Zickus <[email protected]>
This file migrated to kernel/watchdog.c and then combined with kernel/softlockup.c. As a result kernel/nmi_watchdog.c is no longer needed. Just remove it.
LKML-Reference: <[email protected]>
--- kernel/nmi_watchdog.c | 259 ------------------------------------------------- 1 files changed, 0 insertions(+), 259 deletions(-) delete mode 100644 kernel/nmi_watchdog.c
kernel/nmi_watchdog.c deleted +0 -259
@@ -1,259 +0,0 @@ -/* -* Detect Hard Lockups using the NMI -* -* started by Don Zickus, Copyright (C) 2010 Red Hat, Inc. -* -* this code detects hard lockups: incidents in where on a CPU -* the kernel does not respond to anything except NMI. -* -* Note: Most of this code is borrowed heavily from softlockup.c, -* so thanks to Ingo for the initial implementation. -* Some chunks also taken from arch/x86/kernel/apic/nmi.c, thanks -* to those contributors as well. -*/ - -#include <linux/mm.h> -#include <linux/cpu.h> -#include <linux/nmi.h> -#include <linux/init.h> -#include <linux/delay.h> -#include <linux/freezer.h> -#include <linux/lockdep.h> -#include <linux/notifier.h> -#include <linux/module.h> -#include <linux/sysctl.h> - -#include <asm/irq_regs.h> -#include <linux/perf_event.h> - -static DEFINE_PER_CPU(struct perf_event *, nmi_watchdog_ev); -static DEFINE_PER_CPU(int, nmi_watchdog_touch); -static DEFINE_PER_CPU(long, alert_counter); - -static int panic_on_timeout; - -void touch_nmi_watchdog (void ) -{ -__raw_get_cpu_var (nmi_watchdog_touch) =1 ; -touch_softlockup_watchdog (); -} -EXPORT_SYMBOL (touch_nmi_watchdog); - -void touch_all_nmi_watchdog (void ) -{ -int cpu; - -for_each_online_cpu (cpu) -per_cpu (nmi_watchdog_touch, cpu) =1 ; -touch_softlockup_watchdog (); -} - -static int __init setup_nmi_watchdog (char *str) -{ -if (!strncmp (str,"panic" ,5 )) { - panic_on_timeout =1 ; - str =strchr (str,',' ); -if (!str) -return 1 ; - ++str; - } -return 1 ; -} -__setup ("nmi_watchdog=" , setup_nmi_watchdog); - -struct perf_event_attr wd_hw_attr = { - .type =PERF_TYPE_HARDWARE , - .config =PERF_COUNT_HW_CPU_CYCLES , - .size =sizeof (struct perf_event_attr ), - .pinned =1 , - .disabled =1 , -}; - -struct perf_event_attr wd_sw_attr = { - .type =PERF_TYPE_SOFTWARE , - .config =PERF_COUNT_SW_CPU_CLOCK , - .size =sizeof (struct perf_event_attr ), - .pinned =1 , - .disabled =1 , -}; - -void wd_overflow (struct perf_event *event,int nmi, -struct perf_sample_data *data, -struct pt_regs *regs) -{ -int cpu =smp_processor_id (); -int touched =0 ; - -if (__get_cpu_var (nmi_watchdog_touch)) { -per_cpu (nmi_watchdog_touch, cpu) =0 ; - touched =1 ; - } - -/* check to see if the cpu is doing anything */ -if (!touched &&hw_nmi_is_cpu_stuck (regs)) { -/* -* Ayiee, looks like this CPU is stuck ... -* wait a few IRQs (5 seconds) before doing the oops ... -*/ -per_cpu (alert_counter, cpu) +=1 ; -if (per_cpu (alert_counter, cpu) ==5 ) { -if (panic_on_timeout) -panic ("NMI Watchdog detected LOCKUP on cpu %d" , cpu); -else -WARN (1 ,"NMI Watchdog detected LOCKUP on cpu %d" , cpu); - } - }else { -per_cpu (alert_counter, cpu) =0 ; - } - -return ; -} - -static int enable_nmi_watchdog (int cpu) -{ -struct perf_event *event; -struct perf_event_attr *wd_attr; - - event =per_cpu (nmi_watchdog_ev, cpu); -if (event && event->state >PERF_EVENT_STATE_OFF ) -return 0 ; - -if (event ==NULL ) { -/* Try to register using hardware perf events first */ - wd_attr = &wd_hw_attr; - wd_attr->sample_period =hw_nmi_get_sample_period (); - event =perf_event_create_kernel_counter (wd_attr, cpu,-1 , wd_overflow); -if (IS_ERR (event)) { -/* hardware doesn't exist or not supported, fallback to software events */ -printk (KERN_INFO "nmi_watchdog: hardware not available, trying software events\n" ); - wd_attr = &wd_sw_attr; - wd_attr->sample_period =NSEC_PER_SEC ; - event =perf_event_create_kernel_counter (wd_attr, cpu,-1 , wd_overflow); -if (IS_ERR (event)) { -printk (KERN_ERR "nmi watchdog failed to create perf event on %i: %p\n" , cpu, event); -return -1 ; - } - } -per_cpu (nmi_watchdog_ev, cpu) = event; - } -perf_event_enable (per_cpu (nmi_watchdog_ev, cpu)); -return 0 ; -} - -static void disable_nmi_watchdog (int cpu) -{ -struct perf_event *event; - - event =per_cpu (nmi_watchdog_ev, cpu); -if (event) { -perf_event_disable (per_cpu (nmi_watchdog_ev, cpu)); -per_cpu (nmi_watchdog_ev, cpu) =NULL ; -perf_event_release_kernel (event); - } -} - -#ifdef CONFIG_SYSCTL -/* -* proc handler for /proc/sys/kernel/nmi_watchdog -*/ -int nmi_watchdog_enabled; - -int proc_nmi_enabled (struct ctl_table *table,int write, -void __user *buffer,size_t *length,loff_t *ppos) -{ -int cpu; - -if (!write) { -struct perf_event *event; -for_each_online_cpu (cpu) { - event =per_cpu (nmi_watchdog_ev, cpu); -if (event && event->state >PERF_EVENT_STATE_OFF ) { - nmi_watchdog_enabled =1 ; -break ; - } - } -proc_dointvec (table, write, buffer, length, ppos); -return 0 ; - } - -touch_all_nmi_watchdog (); -proc_dointvec (table, write, buffer, length, ppos); -if (nmi_watchdog_enabled) { -for_each_online_cpu (cpu) -if (enable_nmi_watchdog (cpu)) { -printk (KERN_ERR "NMI watchdog failed configuration, " -" can not be enabled\n" ); - } - }else { -for_each_online_cpu (cpu) -disable_nmi_watchdog (cpu); - } -return 0 ; -} - -#endif /* CONFIG_SYSCTL */ - -/* -* Create/destroy watchdog threads as CPUs come and go: -*/ -static int __cpuinit -cpu_callback (struct notifier_block *nfb,unsigned long action,void *hcpu) -{ -int hotcpu = (unsigned long )hcpu; - -switch (action) { -case CPU_UP_PREPARE : -case CPU_UP_PREPARE_FROZEN : -per_cpu (nmi_watchdog_touch, hotcpu) =0 ; -break ; -case CPU_ONLINE : -case CPU_ONLINE_FROZEN : -if (enable_nmi_watchdog (hotcpu)) -return NOTIFY_BAD ; -break ; -#ifdef CONFIG_HOTPLUG_CPU -case CPU_UP_CANCELED : -case CPU_UP_CANCELED_FROZEN : -disable_nmi_watchdog (hotcpu); -case CPU_DEAD : -case CPU_DEAD_FROZEN : -break ; -#endif /* CONFIG_HOTPLUG_CPU */ - } -return NOTIFY_OK ; -} - -static struct notifier_block __cpuinitdata cpu_nfb = { - .notifier_call = cpu_callback -}; - -static int __initdata nonmi_watchdog; - -static int __init nonmi_watchdog_setup (char *str) -{ - nonmi_watchdog =1 ; -return 1 ; -} -__setup ("nonmi_watchdog" , nonmi_watchdog_setup); - -static int __init spawn_nmi_watchdog_task (void ) -{ -void *cpu = (void *)(long )smp_processor_id (); -int err; - -if (nonmi_watchdog) -return 0 ; - -printk (KERN_INFO "NMI watchdog enabled, takes one hw-pmu counter.\n" ); - - err =cpu_callback (&cpu_nfb,CPU_UP_PREPARE , cpu); -if (err ==NOTIFY_BAD ) { -BUG (); -return 1 ; - } -cpu_callback (&cpu_nfb,CPU_ONLINE , cpu); -register_cpu_notifier (&cpu_nfb); - -return 0 ; -} -early_initcall (spawn_nmi_watchdog_task);
Signature · 1 line
1.6.2.3
PATCH 5/9 x86: Move trigger_all_cpu_backtrace to its own die_notifier
In reply to Frederic WeisbeckerFrom: Don Zickus <[email protected]>
As part of the transition of the nmi watchdog to something more generic, the trigger_all_cpu_backtrace code is getting left behind. Put it in its own die_notifier so it can still be used.
V2:
- use arch_spin_locks
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/hw_nmi.c | 65 ++++++++++++++++++++++++++++++++--------- 1 files changed, 51 insertions(+), 14 deletions(-)
arch/x86/kernel/apic/hw_nmi.c +51 -14
@@ -17,6 +17,10 @@#include <linux/cpumask.h> #include <linux/kernel_stat.h> #include <asm/mce.h> +#include <linux/kdebug.h> +#include <linux/notifier.h> +#include <linux/kprobes.h> +#include <linux/nmi.h> #include <linux/module.h>
@@ -54,20 +58,6 @@ int hw_nmi_is_cpu_stuck(struct pt_regs *regs)unsigned int sum;int cpu =smp_processor_id (); -/* FIXME: cheap hack for this check, probably should get its own -* die_notifier handler -*/ -if (cpumask_test_cpu (cpu,to_cpumask (backtrace_mask))) { -static DEFINE_SPINLOCK (lock);/* Serialise the printks */ - -spin_lock (&lock); -printk (KERN_WARNING "NMI backtrace for cpu %d\n" , cpu); -show_regs (regs); -dump_stack (); -spin_unlock (&lock); -cpumask_clear_cpu (cpu,to_cpumask (backtrace_mask)); - } -/* if we are doing an mce, just assume the cpu is not stuck */ /* Could check oops_in_progress here too, but it's safer not to */ if (mce_in_progress ())
@@ -109,6 +99,53 @@ void arch_trigger_all_cpu_backtrace(void) mdelay(1); } } + +static int __kprobes +arch_trigger_all_cpu_backtrace_handler (struct notifier_block *self, +unsigned long cmd,void *__args) +{ +struct die_args *args = __args; +struct pt_regs *regs; +int cpu =smp_processor_id (); + +switch (cmd) { +case DIE_NMI : +case DIE_NMI_IPI : +break ; + +default : +return NOTIFY_DONE ; + } + + regs = args->regs; + +if (cpumask_test_cpu (cpu,to_cpumask (backtrace_mask))) { +static arch_spinlock_t lock = __ARCH_SPIN_LOCK_UNLOCKED; + +arch_spin_lock (&lock); +printk (KERN_WARNING "NMI backtrace for cpu %d\n" , cpu); +show_regs (regs); +dump_stack (); +arch_spin_unlock (&lock); +cpumask_clear_cpu (cpu,to_cpumask (backtrace_mask)); +return NOTIFY_STOP ; + } + +return NOTIFY_DONE ; +} + +static __read_mostly struct notifier_block backtrace_notifier = { + .notifier_call = arch_trigger_all_cpu_backtrace_handler, + .next =NULL , + .priority =1 +}; + +static int __init register_trigger_all_cpu_backtrace (void ) +{ +register_die_notifier (&backtrace_notifier); +return 0 ; +} +early_initcall (register_trigger_all_cpu_backtrace);#endif /* STUB calls to mimic old nmi_watchdog behaviour */
Signature · 1 line
1.6.2.3
PATCH 6/9 x86: Cleanup hw_nmi.c cruft
In reply to Frederic WeisbeckerFrom: Don Zickus <[email protected]>
The design of the hardlockup watchdog has changed and cruft was left behind in the hw_nmi.c file. Just remove the code that isn't used anymore.
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/hw_nmi.c | 58 ----------------------------------------- 1 files changed, 0 insertions(+), 58 deletions(-)
arch/x86/kernel/apic/hw_nmi.c +0 -58
@@ -9,74 +9,16 @@* */ -#include <asm/apic.h> -#include <linux/smp.h> #include <linux/cpumask.h> -#include <linux/sched.h> -#include <linux/percpu.h> -#include <linux/cpumask.h> -#include <linux/kernel_stat.h> -#include <asm/mce.h> #include <linux/kdebug.h> #include <linux/notifier.h> #include <linux/kprobes.h> - -#include <linux/nmi.h> #include <linux/module.h> /* For reliability, we're prepared to waste bits here. */ static DECLARE_BITMAP(backtrace_mask, NR_CPUS) __read_mostly; -static DEFINE_PER_CPU(unsigned, last_irq_sum); - -/* -* Take the local apic timer and PIT/HPET into account. We don't -* know which one is active, when we have highres/dyntick on -*/ -static inline unsigned int get_timer_irqs (int cpu) -{ -unsigned int irqs =per_cpu (irq_stat, cpu).irq0_irqs; - -#if defined(CONFIG_X86_LOCAL_APIC ) - irqs +=per_cpu (irq_stat, cpu).apic_timer_irqs; -#endif - -return irqs; -} - -static inline int mce_in_progress (void ) -{ -#if defined(CONFIG_X86_MCE ) -return atomic_read (&mce_entry) >0 ; -#endif -return 0 ; -} - -int hw_nmi_is_cpu_stuck (struct pt_regs *regs) -{ -unsigned int sum; -int cpu =smp_processor_id (); - -/* if we are doing an mce, just assume the cpu is not stuck */ -/* Could check oops_in_progress here too, but it's safer not to */ -if (mce_in_progress ()) -return 0 ; - -/* We determine if the cpu is stuck by checking whether any -* interrupts have happened since we last checked. Of course -* an nmi storm could create false positives, but the higher -* level logic should account for that -*/ - sum =get_timer_irqs (cpu); -if (__get_cpu_var (last_irq_sum) == sum) { -return 1 ; - }else { -__get_cpu_var (last_irq_sum) = sum; -return 0 ; - } -} -u64 hw_nmi_get_sample_period (void ) {return (u64)(cpu_khz) *1000 *60 ;
Signature · 1 line
1.6.2.3
PATCH 7/9 lockup_detector: Separate touch_nmi_watchdog code path from touch_watchdog
In reply to Frederic WeisbeckerFrom: Don Zickus <[email protected]>
When I combined the nmi_watchdog (hardlockup) and softlockup code, I also combined the paths the touch_watchdog and touch_nmi_watchdog took. This may not be the best idea as pointed out by Frederic W., that the touch_watchdog case probably should not reset the hardlockup count.
Therefore the patch below falls back to the previous idea of keeping the touch_nmi_watchdog a superset of the touch_watchdog case.
LKML-Reference: <[email protected]>
--- kernel/watchdog.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
kernel/watchdog.c +4 -3
@@ -31,6 +31,7 @@ int watchdog_enabled;int __read_mostly softlockup_thresh =60 ; static DEFINE_PER_CPU(unsigned long, watchdog_touch_ts); +static DEFINE_PER_CPU(bool, watchdog_nmi_touch); static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog); static DEFINE_PER_CPU(struct hrtimer, watchdog_hrtimer); static DEFINE_PER_CPU(bool, softlockup_touch_sync);
@@ -139,6 +140,7 @@ void touch_all_softlockup_watchdogs(void)void touch_nmi_watchdog (void ) { +__get_cpu_var (watchdog_nmi_touch) = true;touch_softlockup_watchdog (); }EXPORT_SYMBOL (touch_nmi_watchdog);
@@ -201,10 +203,9 @@ void watchdog_overflow_callback(struct perf_event *event, int nmi, struct pt_regs *regs) {int this_cpu =smp_processor_id (); -unsigned long touch_ts =per_cpu (watchdog_touch_ts, this_cpu); -if (touch_ts ==0 ) { -__touch_watchdog (); +if (__get_cpu_var (watchdog_nmi_touch) == true) { +__get_cpu_var (watchdog_nmi_touch) = false;return ; }
Signature · 1 line
1.6.2.3
PATCH 8/9 lockup_detector: Make BOOTPARAM_SOFTLOCKUP_PANIC depend on LOCKUP_DETECTOR
In reply to Frederic WeisbeckerPanic on softlockups was still depending on the softlockup detector. But the latter has been merged into the lockup detector now.
Let's update this config dependency.
--- lib/Kconfig.debug | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
lib/Kconfig.debug +1 -1
@@ -195,7 +195,7 @@ config LOCKUP_DETECTOR config BOOTPARAM_SOFTLOCKUP_PANIC bool "Panic (Reboot) On Soft Lockups" - depends on DETECT_SOFTLOCKUP + depends on LOCKUP_DETECTOR help Say Y here to enable the kernel to panic on "soft lockups", which are bugs that cause the kernel to loop in kernel
Signature · 1 line
1.6.2.3
PATCH 9/9 lockup_detector: Fix forgotten config conversion
In reply to Frederic WeisbeckerFix forgotten CONFIG_DETECT_SOFTLOCKUP -> CONFIG_LOCKUP_DETECTOR in sched.h
Fixes:
arch/x86/built-in.o: In function `touch_nmi_watchdog': (.text+0x1bd59): undefined reference to `touch_softlockup_watchdog' kernel/built-in.o: In function `show_state_filter': (.text+0x10d01): undefined reference to `touch_all_softlockup_watchdogs' kernel/built-in.o: In function `sched_clock_idle_wakeup_event': (.text+0x362f9): undefined reference to `touch_softlockup_watchdog' kernel/built-in.o: In function `timekeeping_resume': timekeeping.c:(.text+0x38757): undefined reference to `touch_softlockup_watchdog' kernel/built-in.o: In function `tick_nohz_handler': tick-sched.c:(.text+0x3e5b9): undefined reference to `touch_softlockup_watchdog' kernel/built-in.o: In function `tick_sched_timer': tick-sched.c:(.text+0x3e671): undefined reference to `touch_softlockup_watchdog' kernel/built-in.o: In function `tick_check_idle': (.text+0x3e90b): undefined reference to `touch_softlockup_watchdog'
--- include/linux/sched.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/sched.h +1 -1
@@ -311,7 +311,7 @@ extern void scheduler_tick(void);extern void sched_show_task (struct task_struct *p); -#ifdef CONFIG_DETECT_SOFTLOCKUP +#ifdef CONFIG_LOCKUP_DETECTOR extern void touch_softlockup_watchdog (void );extern void touch_softlockup_watchdog_sync (void );extern void touch_all_softlockup_watchdogs (void );
Signature · 1 line
1.6.2.3
Quoted 28 lines · Frederic Weisbecker
Ingo,
Please pull the perf/nmi branch that can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
perf/nmiThere is also a merge of v2.6.34-rc7 to catch up with latest softlockup changes and prevent from conflicts.
Thanks,
Frederic
---Don Zickus (7):
lockup_detector: Combinenmi_watchdogand softlockup detector
lockup_detector:Touch_softlockupcleanups andsoftlockup_tickremoval
lockup_detector: Remove old softlockup code
lockup_detector: Removenmi_watchdog.cfile
x86: Movetrigger_all_cpu_backtraceto its owndie_notifier
x86: Cleanuphw_nmi.ccruft
lockup_detector: Separatetouch_nmi_watchdogcode path fromtouch_watchdogFrederic Weisbecker (2):
lockup_detector: MakeBOOTPARAM_SOFTLOCKUP_PANICdepend onLOCKUP_DETECTOR
lockup_detector: Fix forgotten config conversion
Quoted 16 lines
Documentation/kernel-parameters.txt | 2 + arch/x86/include/asm/nmi.h | 2 +- arch/x86/kernel/apic/Makefile | 4 +- arch/x86/kernel/apic/hw_nmi.c | 119 +++----- arch/x86/kernel/traps.c | 4 +- include/linux/nmi.h | 8 +- include/linux/sched.h | 12 +- init/Kconfig | 5 +- kernel/Makefile | 3 +- kernel/nmi_watchdog.c | 259 ---------------- kernel/softlockup.c | 293 ------------------ kernel/sysctl.c | 52 ++-- kernel/timer.c | 1 - kernel/watchdog.c | 564 +++++++++++++++++++++++++++++++++++ lib/Kconfig.debug | 32 ++- 15 files changed, 679 insertions(+), 681 deletions(-)
Pulled, thanks a lot guys! Was a long process, but the end result looks pretty nifty IMO.
Ingo
[tip:perf/nmi] watchdog: Export touch_softlockup_watchdog
In reply to Frederic WeisbeckerCommit-ID: 0167c781907fcdc3e1f144ef5ce31d402c91eb94 Gitweb: http://git.kernel.org/tip/0167c781907fcdc3e1f144ef5ce31d402c91eb94 Author: Ingo Molnar <[email protected]> AuthorDate: Thu, 13 May 2010 08:53:33 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 May 2010 08:53:33 +0200
watchdog: Export touch_softlockup_watchdog
There are modules that rely on it:
ERROR: "touch_softlockup_watchdog" [drivers/video/nvidia/nvidiafb.ko] undefined!
Cc: Frederic Weisbecker <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Cyrill Gorcunov <[email protected]>
LKML-Reference: <[email protected]>
--- kernel/watchdog.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
kernel/watchdog.c +1 -0
@@ -124,6 +124,7 @@ void touch_softlockup_watchdog(void) {__get_cpu_var (watchdog_touch_ts) =0 ; } +EXPORT_SYMBOL (touch_softlockup_watchdog);void touch_all_softlockup_watchdogs (void ) {
[tip:perf/nmi] x86, watchdog: Fix build error in hw_nmi.c
In reply to Frederic WeisbeckerCommit-ID: 5e85391b3badd3f0e50ebdd0cafe0202a979f73a Gitweb: http://git.kernel.org/tip/5e85391b3badd3f0e50ebdd0cafe0202a979f73a Author: Ingo Molnar <[email protected]> AuthorDate: Thu, 13 May 2010 09:12:39 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 May 2010 09:12:39 +0200
x86, watchdog: Fix build error in hw_nmi.c
On some configs the following build error triggers:
arch/x86/kernel/apic/hw_nmi.c:35: error: 'apic' undeclared (first use in this function) arch/x86/kernel/apic/hw_nmi.c:35: error: (Each undeclared identifier is reported only once arch/x86/kernel/apic/hw_nmi.c:35: error: for each function it appears in.)
Because asm/apic.h was only included implicitly. Include it explicitly.
Cc: Frederic Weisbecker <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Cyrill Gorcunov <[email protected]>
LKML-Reference: <[email protected]>
--- arch/x86/kernel/apic/hw_nmi.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/kernel/apic/hw_nmi.c +1 -0
@@ -8,6 +8,7 @@* Bits copied from original nmi.c file * */ +#include <asm/apic.h> #include <linux/cpumask.h> #include <linux/kdebug.h>