Hi, On Tue, Feb 27, 2024 at 11:22 PM Bitao Hu <yaoma@xxxxxxxxxxxxxxxxx> wrote: > > 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@xxxxxxxxxxxxx> > Signed-off-by: Bitao Hu <yaoma@xxxxxxxxxxxxxxxxx> > Reviewed-by: Liu Song <liusong@xxxxxxxxxxxxxxxxx> > --- > kernel/irq/internals.h | 2 ++ > kernel/irq/irqdesc.c | 16 +++++++++++----- > kernel/irq/proc.c | 6 ++---- > 3 files changed, 15 insertions(+), 9 deletions(-) Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>