genirq: Provide a snapshot mechanism for interrupt statistics
authorBitao Hu <yaoma@linux.alibaba.com>
Thu, 11 Apr 2024 07:41:31 +0000 (15:41 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 12 Apr 2024 15:08:05 +0000 (17:08 +0200)
commit99cf63c56661be0a0c42f79b56f37a4aa34b4779
tree10cdfb0ae0ed029482ac5f33efcaad5092fc7ffb
parent86d2a2f51fbada84e377665df06b5a479a1edc99
genirq: Provide a snapshot mechanism for interrupt statistics

The soft lockup detector lacks a mechanism to identify interrupt storms as
root cause of a lockup. To enable this the detector needs a mechanism to
snapshot the interrupt count statistics on a CPU when the detector observes
a potential lockup scenario and compare that against the interrupt count
when it warns about the lockup later on. The number of interrupts in that
period give a hint whether the lockup might have been caused by an interrupt
storm.

Instead of having extra storage in the lockup detector and accessing the
internals of the interrupt descriptor directly, add a snapshot member to
the per CPU irq_desc::kstat_irq structure and provide interfaces to take a
snapshot of all interrupts on the current CPU and to retrieve the delta of
a specific interrupt later on.

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-3-yaoma@linux.alibaba.com
include/linux/irqdesc.h
include/linux/kernel_stat.h
kernel/irq/Kconfig
kernel/irq/irqdesc.c