[PATCHv11 3/4] genirq: Avoid summation loops for /proc/interrupts
Doug Anderson
dianders at chromium.org
Thu Feb 29 09:44:50 AEDT 2024
Hi,
On Tue, Feb 27, 2024 at 11:22 PM Bitao Hu <yaoma at linux.alibaba.com> 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 at linutronix.de>
> Signed-off-by: Bitao Hu <yaoma at linux.alibaba.com>
> Reviewed-by: Liu Song <liusong at linux.alibaba.com>
> ---
> 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 at chromium.org>
More information about the Linuxppc-dev
mailing list