mbox series

[0/2] genirq/proc: Speed up show_interrupts()

Message ID 20240513120548.14046-1-ahuang12@lenovo.com (mailing list archive)
Headers show
Series genirq/proc: Speed up show_interrupts() | expand

Message

Adrian Huang May 13, 2024, 12:05 p.m. UTC
Since there are irq number allocation holes, we can jump over those
holes in order to speed up show_interrupts().

In addition, the percpu kstat_irqs access logic can be refined.

System Configuration
====================
  * 2-socket server with 488 cores (HT-enabled).
  * The last allocated irq is 508.
  * nr_irqs = 8360. The following is from dmesg.
     NR_IRQS: 524544, nr_irqs: 8360, preallocated irqs: 16

  The biggest hole: 7852 iterations (8360 - 509 + 1) are not necessary.


Test Result
===========
  * The following result is the average execution time of ten-time
    measurements about `time cat /proc/interrupts`.

  no patch (ms)     patched (ms)     saved
  -------------     ------------    -------
           52.4             47.3       9.7%

Adrian Huang (2):
  genirq/proc: Try to jump over the unallocated irq hole whenever
    possible
  genirq/proc: Refine percpu kstat_irqs access logic

 fs/proc/interrupts.c |  6 ++++++
 kernel/irq/proc.c    | 26 ++++++++++++++++++--------
 2 files changed, 24 insertions(+), 8 deletions(-)