genirq/proc: Speed up /proc/interrupts iteration
authorThomas Gleixner <tglx@kernel.org>
Sun, 17 May 2026 20:02:49 +0000 (22:02 +0200)
committerThomas Gleixner <tglx@kernel.org>
Tue, 26 May 2026 14:21:15 +0000 (16:21 +0200)
commit171cc0d9eed1cad5de7ce6a212efbeda390edb0f
tree25f3a0cbb7dfcc4c45468f8f7434ada5933ca20d
parent61b51a167c524b65a59b1342e70c2008d514a796
genirq/proc: Speed up /proc/interrupts iteration

Reading /proc/interrupts iterates over the interrupt number space one by
one and looks up the descriptors one by one. That's just a waste of time.

When CONFIG_GENERIC_IRQ_SHOW is enabled this can utilize the maple tree and
cache the descriptor pointer efficiently for the sequence file operations.

Implement a CONFIG_GENERIC_IRQ_SHOW specific version in the core code and
leave the fs/proc/ variant for the legacy architectures which ignore generic
code.

This reduces the time wasted for looking up the next record significantly.

Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Reviewed-by: Dmitry Ilvokhin <d@ilvokhin.com>
Link: https://patch.msgid.link/20260517194932.165280601@kernel.org
fs/proc/Makefile
kernel/irq/proc.c