OpenVZ Forum - RDF feed
type: channel
items: [PATCH COMMIT] diff-smp-nmi-show-regs

[PATCH COMMIT] diff-smp-nmi-show-regs
type: item
description: Added to 026test008 Patch from OpenVZ team <devel@openvz.org> This patch adds dumping of calltraces on _all_ CPUs on AltSysRq-P and NMI LOCKUP. It does this via sending NMI IPI interrupts to the cpus. Taken back from -mm tree. Signed-off-by: Kirill Korotaev <dev@sw.ru> Signed-off-by: Pavel Emelianov <xemul@sw.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> diff -puN arch/i386/kernel/nmi.c~nmi-lockup-and-altsysrq-p-dumping-cal ltraces-on-_all_-cpus arch/i386/kernel/nmi.c --- devel/arch/i386/kernel/nmi.c~nmi-lockup-and-altsysrq-p-dumpi ng-calltraces-on-_all_-cpus 2006-03-18 00:55:33.000000000 -0800 +++ devel-akpm/arch/i386/kernel/nmi.c 2006-03-18 01:11:52.000000000 -0800 @@ -523,6 +523,21 @@ void touch_nmi_watchdog (void) extern void die_nmi(struct pt_regs *, const char *msg); +static spinlock_t show_regs_lock = SPIN_LOCK_UNLOCKED; + +void smp_show_regs(struct pt_regs *regs, void *info) +{ + if (regs == NULL) + return; + + bust_spinlocks(1); + spin_lock(&show_regs_lock); + printk("----------- IPI show regs -----------"); + show_regs(regs); + spin_unlock(&show_regs_lock); + bust_spinlocks(0); +} + void nmi_watchdog_tick (struct pt_regs * regs) { diff -puN arch/i386/kernel/smp.c~nmi-lockup-and-altsysrq-p-dumping-cal ltraces-on-_all_-cpus arch/i386/kernel/smp.c --- devel/arch/i386/kernel/smp.c~nmi-lockup-and-altsysrq-p-dumpi ng-calltraces-on-_all_-cpus 2006-03-18 00:55:33.000000000 -0800 +++ devel-akpm/arch/i386/kernel/smp.c 2006-03-18 00:55:33.000000000 -0800 @@ -21,6 +21,7 @@ #include <linux/cpu.h> #include <linux/module.h> +#include <asm/nmi.h> #include <asm/mtrr.h> #include <asm/tlbflush.h> #include <mach_apic.h> @@ -562,6 +563,89 @@ int smp_call_function (void (*func) (voi } EXPORT_SYMBOL(smp_call_function); +static spinlock_t nmi_call_lock = SPIN_LOCK_UNLOCKED; +static struct nmi_call_data_struct { + smp_nmi_function func; + void *info; + atomic_t started; + atomic_t finished; + cpumask_t cpus_called; + int wait; +} *nmi_call_data; + +static int smp_nmi_callback(s…
creator: xemul
date: 2006-04-05T10:30:26-00:00