Commit 17081102 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt

powerpc: Convert global "BAD" interrupt to per cpu spurious

I often get asked if BAD interrupts are really bad. On some boxes (eg
IBM machines running a hypervisor) there are valid cases where are
presented with an interrupt that is not for us. These cases are common
enough to show up as thousands of BAD interrupts a day.

Tone them down by calling them spurious. Since they can be a significant cause
of OS jitter, we may as well log them per cpu so we know where they are
occurring.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 89713ed1
...@@ -9,6 +9,7 @@ typedef struct { ...@@ -9,6 +9,7 @@ typedef struct {
unsigned int timer_irqs; unsigned int timer_irqs;
unsigned int pmu_irqs; unsigned int pmu_irqs;
unsigned int mce_exceptions; unsigned int mce_exceptions;
unsigned int spurious_irqs;
} ____cacheline_aligned irq_cpustat_t; } ____cacheline_aligned irq_cpustat_t;
DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
...@@ -25,7 +26,4 @@ static inline void ack_bad_irq(unsigned int irq) ...@@ -25,7 +26,4 @@ static inline void ack_bad_irq(unsigned int irq)
extern u64 arch_irq_stat_cpu(unsigned int cpu); extern u64 arch_irq_stat_cpu(unsigned int cpu);
#define arch_irq_stat_cpu arch_irq_stat_cpu #define arch_irq_stat_cpu arch_irq_stat_cpu
extern u64 arch_irq_stat(void);
#define arch_irq_stat arch_irq_stat
#endif /* _ASM_POWERPC_HARDIRQ_H */ #endif /* _ASM_POWERPC_HARDIRQ_H */
...@@ -77,7 +77,6 @@ DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat); ...@@ -77,7 +77,6 @@ DEFINE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
EXPORT_PER_CPU_SYMBOL(irq_stat); EXPORT_PER_CPU_SYMBOL(irq_stat);
int __irq_offset_value; int __irq_offset_value;
static int ppc_spurious_interrupts;
#ifdef CONFIG_PPC32 #ifdef CONFIG_PPC32
EXPORT_SYMBOL(__irq_offset_value); EXPORT_SYMBOL(__irq_offset_value);
...@@ -201,6 +200,11 @@ static int show_other_interrupts(struct seq_file *p, int prec) ...@@ -201,6 +200,11 @@ static int show_other_interrupts(struct seq_file *p, int prec)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).timer_irqs); seq_printf(p, "%10u ", per_cpu(irq_stat, j).timer_irqs);
seq_printf(p, " Local timer interrupts\n"); seq_printf(p, " Local timer interrupts\n");
seq_printf(p, "%*s: ", prec, "SPU");
for_each_online_cpu(j)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).spurious_irqs);
seq_printf(p, " Spurious interrupts\n");
seq_printf(p, "%*s: ", prec, "CNT"); seq_printf(p, "%*s: ", prec, "CNT");
for_each_online_cpu(j) for_each_online_cpu(j)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).pmu_irqs); seq_printf(p, "%10u ", per_cpu(irq_stat, j).pmu_irqs);
...@@ -211,8 +215,6 @@ static int show_other_interrupts(struct seq_file *p, int prec) ...@@ -211,8 +215,6 @@ static int show_other_interrupts(struct seq_file *p, int prec)
seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions); seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions);
seq_printf(p, " Machine check exceptions\n"); seq_printf(p, " Machine check exceptions\n");
seq_printf(p, "%*s: %10u\n", prec, "BAD", ppc_spurious_interrupts);
return 0; return 0;
} }
...@@ -282,13 +284,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu) ...@@ -282,13 +284,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
sum += per_cpu(irq_stat, cpu).pmu_irqs; sum += per_cpu(irq_stat, cpu).pmu_irqs;
sum += per_cpu(irq_stat, cpu).mce_exceptions; sum += per_cpu(irq_stat, cpu).mce_exceptions;
sum += per_cpu(irq_stat, cpu).spurious_irqs;
return sum;
}
u64 arch_irq_stat(void)
{
u64 sum = ppc_spurious_interrupts;
return sum; return sum;
} }
...@@ -404,8 +400,7 @@ void do_IRQ(struct pt_regs *regs) ...@@ -404,8 +400,7 @@ void do_IRQ(struct pt_regs *regs)
if (irq != NO_IRQ && irq != NO_IRQ_IGNORE) if (irq != NO_IRQ && irq != NO_IRQ_IGNORE)
handle_one_irq(irq); handle_one_irq(irq);
else if (irq != NO_IRQ_IGNORE) else if (irq != NO_IRQ_IGNORE)
/* That's not SMP safe ... but who cares ? */ __get_cpu_var(irq_stat).spurious_irqs++;
ppc_spurious_interrupts++;
irq_exit(); irq_exit();
set_irq_regs(old_regs); set_irq_regs(old_regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment