powerpc: Add accounting for Doorbell interrupts
authorIan Munsie <imunsie@au1.ibm.com>
Thu, 21 Mar 2013 19:22:52 +0000 (19:22 +0000)
committerMichael Ellerman <michael@ellerman.id.au>
Thu, 18 Apr 2013 05:59:55 +0000 (15:59 +1000)
This patch adds a new line to /proc/interrupts to account for the
doorbell interrupts that each hardware thread has received. The total
interrupt count in /proc/stat will now also include doorbells.

 # cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3
 16:        551       1267        281        175      XICS Level     IPI
LOC:       2037       1503       1688       1625   Local timer interrupts
SPU:          0          0          0          0   Spurious interrupts
CNT:          0          0          0          0   Performance monitoring interrupts
MCE:          0          0          0          0   Machine check exceptions
DBL:         42        550         20         91   Doorbell interrupts

Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
arch/powerpc/include/asm/hardirq.h
arch/powerpc/kernel/dbell.c
arch/powerpc/kernel/irq.c

index 3147a29701254eb882bbd1995f03b862e2e6c4e1..3bdcfce2c42a926bebc7c2f580ee720f96350818 100644 (file)
@@ -10,6 +10,9 @@ typedef struct {
        unsigned int pmu_irqs;
        unsigned int mce_exceptions;
        unsigned int spurious_irqs;
+#ifdef CONFIG_PPC_DOORBELL
+       unsigned int doorbell_irqs;
+#endif
 } ____cacheline_aligned irq_cpustat_t;
 
 DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
index 9ebbc24bb23c397bbdc446fd2f67152f73e391f5..d55c76c571f38dce85137b7e28e8a6d2f59aaf38 100644 (file)
@@ -41,6 +41,8 @@ void doorbell_exception(struct pt_regs *regs)
 
        may_hard_irq_enable();
 
+       __get_cpu_var(irq_stat).doorbell_irqs++;
+
        smp_ipi_demux();
 
        irq_exit();
index 4f97fe345526c7817d068c79bc13f3ed921e36f8..5cbcf4d5a808db3f2d25fdc4fe01ea26e3d0f247 100644 (file)
@@ -374,6 +374,15 @@ int arch_show_interrupts(struct seq_file *p, int prec)
                seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions);
        seq_printf(p, "  Machine check exceptions\n");
 
+#ifdef CONFIG_PPC_DOORBELL
+       if (cpu_has_feature(CPU_FTR_DBELL)) {
+               seq_printf(p, "%*s: ", prec, "DBL");
+               for_each_online_cpu(j)
+                       seq_printf(p, "%10u ", per_cpu(irq_stat, j).doorbell_irqs);
+               seq_printf(p, "  Doorbell interrupts\n");
+       }
+#endif
+
        return 0;
 }
 
@@ -387,6 +396,9 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
        sum += per_cpu(irq_stat, cpu).pmu_irqs;
        sum += per_cpu(irq_stat, cpu).mce_exceptions;
        sum += per_cpu(irq_stat, cpu).spurious_irqs;
+#ifdef CONFIG_PPC_DOORBELL
+       sum += per_cpu(irq_stat, cpu).doorbell_irqs;
+#endif
 
        return sum;
 }