Skip to content

Commit a6a058e

Browse files
Ian Munsiempe
authored andcommitted
powerpc: Add accounting for Doorbell interrupts
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 6143569 commit a6a058e

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

arch/powerpc/include/asm/hardirq.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ typedef struct {
1010
unsigned int pmu_irqs;
1111
unsigned int mce_exceptions;
1212
unsigned int spurious_irqs;
13+
#ifdef CONFIG_PPC_DOORBELL
14+
unsigned int doorbell_irqs;
15+
#endif
1316
} ____cacheline_aligned irq_cpustat_t;
1417

1518
DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);

arch/powerpc/kernel/dbell.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ void doorbell_exception(struct pt_regs *regs)
4141

4242
may_hard_irq_enable();
4343

44+
__get_cpu_var(irq_stat).doorbell_irqs++;
45+
4446
smp_ipi_demux();
4547

4648
irq_exit();

arch/powerpc/kernel/irq.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,15 @@ int arch_show_interrupts(struct seq_file *p, int prec)
374374
seq_printf(p, "%10u ", per_cpu(irq_stat, j).mce_exceptions);
375375
seq_printf(p, " Machine check exceptions\n");
376376

377+
#ifdef CONFIG_PPC_DOORBELL
378+
if (cpu_has_feature(CPU_FTR_DBELL)) {
379+
seq_printf(p, "%*s: ", prec, "DBL");
380+
for_each_online_cpu(j)
381+
seq_printf(p, "%10u ", per_cpu(irq_stat, j).doorbell_irqs);
382+
seq_printf(p, " Doorbell interrupts\n");
383+
}
384+
#endif
385+
377386
return 0;
378387
}
379388

@@ -387,6 +396,9 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
387396
sum += per_cpu(irq_stat, cpu).pmu_irqs;
388397
sum += per_cpu(irq_stat, cpu).mce_exceptions;
389398
sum += per_cpu(irq_stat, cpu).spurious_irqs;
399+
#ifdef CONFIG_PPC_DOORBELL
400+
sum += per_cpu(irq_stat, cpu).doorbell_irqs;
401+
#endif
390402

391403
return sum;
392404
}

0 commit comments

Comments
 (0)