mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
bitkeeper revision 1.1236.1.124 (42429eb8uGingMvF7MF3Py6CUzFBzA)
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@xensource.com>
This commit is contained in:
1 parent
36b6dd3b86
commit
b7a2d3eb8c
5 files changed
+16
-21
No files matched your search
@@ -722,15 +722,10 @@ int reprogram_ac_timer(s_time_t timeout)
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -271,7 +271,7 @@ void nmi_watchdog_tick (struct xen_regs * regs)
|
||||
{
|
||||
int sum, cpu = smp_processor_id();
|
||||
|
||||
sum = apic_timer_irqs[cpu];
|
||||
sum = ac_timers[cpu].softirqs;
|
||||
|
||||
if ( (last_irq_sums[cpu] == sum) && watchdog_on )
|
||||
{
|
||||
|
||||
+7
-10
@@ -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 @@ static void ac_timer_softirq_action(void)
|
||||
s_time_t now;
|
||||
void (*fn)(unsigned long);
|
||||
|
||||
ac_timers[cpu].softirqs++;
|
||||
|
||||
spin_lock_irq(&ac_timers[cpu].lock);
|
||||
|
||||
do {
|
||||
@@ -277,8 +272,10 @@ void __init ac_timer_init(void)
|
||||
|
||||
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);
|
||||
|
||||
@@ -83,12 +83,7 @@ extern int APIC_init_uniprocessor (void);
|
||||
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;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef _AC_TIMER_H_
|
||||
#define _AC_TIMER_H_
|
||||
|
||||
#include <xen/spinlock.h>
|
||||
#include <xen/time.h>
|
||||
|
||||
struct ac_timer {
|
||||
@@ -87,6 +88,13 @@ extern void mod_ac_timer(struct ac_timer *timer, s_time_t new_time);
|
||||
|
||||
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_ */
|
||||
|
||||
/*
|
||||
|
||||