diff options
author | Bitao Hu <yaoma@linux.alibaba.com> | 2024-04-11 09:41:30 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-04-12 17:08:05 +0200 |
commit | 86d2a2f51fbada84e377665df06b5a479a1edc99 (patch) | |
tree | 4d4841bbc3a1d129a8cc9d6793bb19fb52553720 /kernel/irq/proc.c | |
parent | genirq: Update MAINTAINERS to include interrupt related header files (diff) | |
download | linux-86d2a2f51fbada84e377665df06b5a479a1edc99.tar.xz linux-86d2a2f51fbada84e377665df06b5a479a1edc99.zip |
genirq: Convert kstat_irqs to a struct
The irq_desc::kstat_irqs member is a per-CPU variable of type int, which is
only capable of counting. A snapshot mechanism for interrupt statistics
will be added soon, which requires an additional variable to store the
snapshot.
To facilitate expansion, convert kstat_irqs here to a struct containing
only the count.
Originally-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Bitao Hu <yaoma@linux.alibaba.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240411074134.30922-2-yaoma@linux.alibaba.com
Diffstat (limited to 'kernel/irq/proc.c')
-rw-r--r-- | kernel/irq/proc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 623b8136e9af..6954e0a02047 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -490,7 +490,7 @@ int show_interrupts(struct seq_file *p, void *v) if (desc->kstat_irqs) { for_each_online_cpu(j) - any_count |= data_race(*per_cpu_ptr(desc->kstat_irqs, j)); + any_count |= data_race(per_cpu(desc->kstat_irqs->cnt, j)); } if ((!desc->action || irq_desc_is_chained(desc)) && !any_count) @@ -498,8 +498,7 @@ int show_interrupts(struct seq_file *p, void *v) seq_printf(p, "%*d: ", prec, i); for_each_online_cpu(j) - seq_printf(p, "%10u ", desc->kstat_irqs ? - *per_cpu_ptr(desc->kstat_irqs, j) : 0); + seq_printf(p, "%10u ", desc->kstat_irqs ? per_cpu(desc->kstat_irqs->cnt, j) : 0); raw_spin_lock_irqsave(&desc->lock, flags); if (desc->irq_data.chip) { |