summaryrefslogtreecommitdiff
path: root/kernel/irq/internals.h
diff options
context:
space:
mode:
authorBitao Hu <yaoma@linux.alibaba.com>2024-04-11 15:41:32 +0800
committerThomas Gleixner <tglx@linutronix.de>2024-04-12 17:08:05 +0200
commit25a4a015118037809c97d089d69e927737e589e1 (patch)
tree08f068eb3cdf341741c41672ee78adcfcbfef726 /kernel/irq/internals.h
parent99cf63c56661be0a0c42f79b56f37a4aa34b4779 (diff)
genirq: Avoid summation loops for /proc/interrupts
show_interrupts() unconditionally accumulates the per CPU interrupt statistics to determine whether an interrupt was ever raised. This can be avoided for all interrupts which are not strictly per CPU and not of type NMI because those interrupts provide already an accumulated counter. The required logic is already implemented in kstat_irqs(). Split the inner access logic out of kstat_irqs() and use it for kstat_irqs() and show_interrupts() to avoid the accumulation loop when possible. Originally-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Bitao Hu <yaoma@linux.alibaba.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Liu Song <liusong@linux.alibaba.com> Reviewed-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20240411074134.30922-4-yaoma@linux.alibaba.com
Diffstat (limited to 'kernel/irq/internals.h')
-rw-r--r--kernel/irq/internals.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
index 1d92532c2aae..6c43ef3e7308 100644
--- a/kernel/irq/internals.h
+++ b/kernel/irq/internals.h
@@ -98,6 +98,8 @@ extern void mask_irq(struct irq_desc *desc);
extern void unmask_irq(struct irq_desc *desc);
extern void unmask_threaded_irq(struct irq_desc *desc);
+extern unsigned int kstat_irqs_desc(struct irq_desc *desc, const struct cpumask *cpumask);
+
#ifdef CONFIG_SPARSE_IRQ
static inline void irq_mark_irq(unsigned int irq) { }
#else