[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] NMI watchdog hooks off ac_timer softirq rather than apic timer irq.
ChangeSet 1.1360, 2005/03/24 11:04:24+00:00, kaf24@xxxxxxxxxxxxxxxxxxxx NMI watchdog hooks off ac_timer softirq rather than apic timer irq. In extreme situations we may service ac_timer events without ever actually taking an apic interrupt. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> arch/x86/apic.c | 5 ----- arch/x86/nmi.c | 2 +- common/ac_timer.c | 17 +++++++---------- include/asm-x86/apic.h | 5 ----- include/xen/ac_timer.h | 8 ++++++++ 5 files changed, 16 insertions(+), 21 deletions(-) diff -Nru a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c --- a/xen/arch/x86/apic.c 2005-03-24 07:02:49 -05:00 +++ b/xen/arch/x86/apic.c 2005-03-24 07:02:49 -05:00 @@ -722,15 +722,10 @@ return 1; } -unsigned int apic_timer_irqs [NR_CPUS]; - void smp_apic_timer_interrupt(struct xen_regs * regs) { ack_APIC_irq(); - - apic_timer_irqs[smp_processor_id()]++; perfc_incrc(apic_timer); - raise_softirq(AC_TIMER_SOFTIRQ); } diff -Nru a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c --- a/xen/arch/x86/nmi.c 2005-03-24 07:02:49 -05:00 +++ b/xen/arch/x86/nmi.c 2005-03-24 07:02:49 -05:00 @@ -271,7 +271,7 @@ { int sum, cpu = smp_processor_id(); - sum = apic_timer_irqs[cpu]; + sum = ac_timers[cpu].softirqs; if ( (last_irq_sums[cpu] == sum) && watchdog_on ) { diff -Nru a/xen/common/ac_timer.c b/xen/common/ac_timer.c --- a/xen/common/ac_timer.c 2005-03-24 07:02:49 -05:00 +++ b/xen/common/ac_timer.c 2005-03-24 07:02:49 -05:00 @@ -34,14 +34,7 @@ #define DEFAULT_HEAP_LIMIT 127 -/* A timer list per CPU */ -typedef struct ac_timers_st -{ - spinlock_t lock; - struct ac_timer **heap; -} __cacheline_aligned ac_timers_t; -static ac_timers_t ac_timers[NR_CPUS]; - +struct ac_timers ac_timers[NR_CPUS]; /**************************************************************************** * HEAP OPERATIONS. @@ -214,6 +207,8 @@ s_time_t now; void (*fn)(unsigned long); + ac_timers[cpu].softirqs++; + spin_lock_irq(&ac_timers[cpu].lock); do { @@ -277,8 +272,10 @@ for ( i = 0; i < smp_num_cpus; i++ ) { - ac_timers[i].heap = xmalloc_array(struct ac_timer *, DEFAULT_HEAP_LIMIT+1); - if ( ac_timers[i].heap == NULL ) BUG(); + ac_timers[i].heap = xmalloc_array( + struct ac_timer *, DEFAULT_HEAP_LIMIT+1); + BUG_ON(ac_timers[i].heap == NULL); + SET_HEAP_SIZE(ac_timers[i].heap, 0); SET_HEAP_LIMIT(ac_timers[i].heap, DEFAULT_HEAP_LIMIT); spin_lock_init(&ac_timers[i].lock); diff -Nru a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h --- a/xen/include/asm-x86/apic.h 2005-03-24 07:02:49 -05:00 +++ b/xen/include/asm-x86/apic.h 2005-03-24 07:02:49 -05:00 @@ -83,12 +83,7 @@ extern void disable_APIC_timer(void); extern void enable_APIC_timer(void); -/*extern struct pm_dev *apic_pm_register(pm_dev_t, unsigned long, pm_callback);*/ -/*extern void apic_pm_unregister(struct pm_dev*);*/ - extern unsigned int watchdog_on; - -extern unsigned int apic_timer_irqs [NR_CPUS]; extern int check_nmi_watchdog (void); extern unsigned int nmi_watchdog; diff -Nru a/xen/include/xen/ac_timer.h b/xen/include/xen/ac_timer.h --- a/xen/include/xen/ac_timer.h 2005-03-24 07:02:49 -05:00 +++ b/xen/include/xen/ac_timer.h 2005-03-24 07:02:49 -05:00 @@ -19,6 +19,7 @@ #ifndef _AC_TIMER_H_ #define _AC_TIMER_H_ +#include <xen/spinlock.h> #include <xen/time.h> struct ac_timer { @@ -86,6 +87,13 @@ */ extern int reprogram_ac_timer(s_time_t timeout); + +struct ac_timers { + spinlock_t lock; + struct ac_timer **heap; + unsigned int softirqs; +} __cacheline_aligned; +extern struct ac_timers ac_timers[]; #endif /* _AC_TIMER_H_ */ ------------------------------------------------------- This SF.net email is sponsored by Microsoft Mobile & Embedded DevCon 2005 Attend MEDC 2005 May 9-12 in Vegas. Learn more about the latest Windows Embedded(r) & Windows Mobile(tm) platforms, applications & content. Register by 3/29 & save $300 http://ads.osdn.com/?ad_id=6883&alloc_id=15149&op=click _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |