<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/kernel/irq/proc.c, branch v7.2-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>genirq/proc: Speed up /proc/interrupts iteration</title>
<updated>2026-05-26T14:21:15+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:02:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=171cc0d9eed1cad5de7ce6a212efbeda390edb0f'/>
<id>171cc0d9eed1cad5de7ce6a212efbeda390edb0f</id>
<content type='text'>
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 &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Link: https://patch.msgid.link/20260517194932.165280601@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Link: https://patch.msgid.link/20260517194932.165280601@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq/proc: Runtime size the chip name</title>
<updated>2026-05-26T14:21:15+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:02:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=61b51a167c524b65a59b1342e70c2008d514a796'/>
<id>61b51a167c524b65a59b1342e70c2008d514a796</id>
<content type='text'>
The chip name column in the /proc/interrupt output is 8 characters and
right aligned, which causes visual clutter due to the fixed length and the
alignment. Many interrupt chips, e.g. PCI/MSI[X] have way longer names.

Update the length when a chip is assigned to an interrupt and utilize this
information for the output. Align it left so all chip names start at the
begin of the column.

Update the GDB script as well and disentangle the header maze so it
actually works with all .config combinations.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Link: https://patch.msgid.link/20260517194932.085786035@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The chip name column in the /proc/interrupt output is 8 characters and
right aligned, which causes visual clutter due to the fixed length and the
alignment. Many interrupt chips, e.g. PCI/MSI[X] have way longer names.

Update the length when a chip is assigned to an interrupt and utilize this
information for the output. Align it left so all chip names start at the
begin of the column.

Update the GDB script as well and disentangle the header maze so it
actually works with all .config combinations.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Link: https://patch.msgid.link/20260517194932.085786035@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq/proc: Increase default interrupt number precision to four</title>
<updated>2026-05-26T14:21:14+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:02:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=34594da7650d3ea67f96c0f4034ff6b2453f67c3'/>
<id>34594da7650d3ea67f96c0f4034ff6b2453f67c3</id>
<content type='text'>
Quite some architectures have four character wide acronyms for architecture
specific interrupts like IPI, NMI, etc.

The default precision of printing the Linux device interrupt numbers is
three, which causes quite some code to play games with adding or omitting
space after the acronym and the colon in order to keep the per CPU numbers
properly aligned.

Increase the default number precision to four in the core code and get rid
of the space games all over the place. At the same time align all
architecture specific descriptor texts left so that they show up in the
same column as the interrupt chip names, which makes the output more
uniform accross architectures. Fix up the GDB script to this new scheme as
well.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260517194931.839482411@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Quite some architectures have four character wide acronyms for architecture
specific interrupts like IPI, NMI, etc.

The default precision of printing the Linux device interrupt numbers is
three, which causes quite some code to play games with adding or omitting
space after the acronym and the colon in order to keep the per CPU numbers
properly aligned.

Increase the default number precision to four in the core code and get rid
of the space games all over the place. At the same time align all
architecture specific descriptor texts left so that they show up in the
same column as the interrupt chip names, which makes the output more
uniform accross architectures. Fix up the GDB script to this new scheme as
well.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260517194931.839482411@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Calculate precision only when required</title>
<updated>2026-05-26T14:21:14+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:02:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2d62735f1d4a2832af367c9e3de04bfb280a945c'/>
<id>2d62735f1d4a2832af367c9e3de04bfb280a945c</id>
<content type='text'>
Calculating the precision of the interrupt number column on every initial
show_interrupt() invocation is a pointless exercise as the underlying
maximum number of interrupts rarely changes.

Calculate it only when that number is modified and let show_interrupts()
use the cached value.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Link: https://patch.msgid.link/20260517194931.760664517@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Calculating the precision of the interrupt number column on every initial
show_interrupt() invocation is a pointless exercise as the underlying
maximum number of interrupts rarely changes.

Calculate it only when that number is modified and let show_interrupts()
use the cached value.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Link: https://patch.msgid.link/20260517194931.760664517@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Cache the condition for /proc/interrupts exposure</title>
<updated>2026-05-26T14:21:13+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:02:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4892e5e71ec9c942293cea7fd26e0c76179211ed'/>
<id>4892e5e71ec9c942293cea7fd26e0c76179211ed</id>
<content type='text'>
show_interrupts() evaluates a boatload of conditions to establish whether
it should expose an interrupt in /proc/interrupts or not.

That can be simplified by caching the condition in an internal status flag,
which is updated when one of the relevant inputs changes.

The irq_desc::kstat_irq check is dropped because visible interrupt
descriptors always have a valid pointer.

As a result the number of instructions and branches for reading
/proc/interrupts is reduced significantly.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Link: https://patch.msgid.link/20260517194931.680943749@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
show_interrupts() evaluates a boatload of conditions to establish whether
it should expose an interrupt in /proc/interrupts or not.

That can be simplified by caching the condition in an internal status flag,
which is updated when one of the relevant inputs changes.

The irq_desc::kstat_irq check is dropped because visible interrupt
descriptors always have a valid pointer.

As a result the number of instructions and branches for reading
/proc/interrupts is reduced significantly.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Link: https://patch.msgid.link/20260517194931.680943749@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq: Expose nr_irqs in core code</title>
<updated>2026-05-26T14:21:13+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:02:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b99dc723b12ea587fc8b2e07bd8401433eec58d8'/>
<id>b99dc723b12ea587fc8b2e07bd8401433eec58d8</id>
<content type='text'>
... to avoid function calls in the core code to retrieve the maximum number
of interrupts.

Rename it to 'total_nr_irqs' as 'nr_irqs' is too generic and fix up the
'nr_irqs' reference in the related GDB script as well.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Reviewed-by: Shrikanth Hegde &lt;sshegde@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260517194931.522168332@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
... to avoid function calls in the core code to retrieve the maximum number
of interrupts.

Rename it to 'total_nr_irqs' as 'nr_irqs' is too generic and fix up the
'nr_irqs' reference in the related GDB script as well.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Reviewed-by: Shrikanth Hegde &lt;sshegde@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260517194931.522168332@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq/proc: Utilize irq_desc::tot_count to avoid evaluation</title>
<updated>2026-05-26T14:21:11+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:01:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0179464391af9a01b911f441d2dda42ea253dfbd'/>
<id>0179464391af9a01b911f441d2dda42ea253dfbd</id>
<content type='text'>
Interrupts which are not marked per CPU increment not only the per CPU
statistics, but also the accumulation counter irq_desc::tot_count.

Change the counter to type unsigned long so it does not produce sporadic
zeros due to wrap arounds on 64-bit machines and do a quick check for non
per CPU interrupts. If the counter is zero, then simply emit a full set of
zero strings. That spares the evaluation of the per CPU counters completely
for interrupts with zero events.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Link: https://patch.msgid.link/20260517194931.115522199@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Interrupts which are not marked per CPU increment not only the per CPU
statistics, but also the accumulation counter irq_desc::tot_count.

Change the counter to type unsigned long so it does not produce sporadic
zeros due to wrap arounds on 64-bit machines and do a quick check for non
per CPU interrupts. If the counter is zero, then simply emit a full set of
zero strings. That spares the evaluation of the per CPU counters completely
for interrupts with zero events.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Link: https://patch.msgid.link/20260517194931.115522199@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq/proc: Avoid formatting zero counts in /proc/interrupts</title>
<updated>2026-05-26T14:21:11+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@kernel.org</email>
</author>
<published>2026-05-17T20:01:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=95c33a64f203be444954a1e1d855a4820c4f0efa'/>
<id>95c33a64f203be444954a1e1d855a4820c4f0efa</id>
<content type='text'>
A large portion of interrupt count entries are zero. There is no point in
formatting the zero value as it is way cheeper to just emit a constant
string.

Collect the number of consecutive zero counts and emit them in one go
before a non-zero count and at the end of the line.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Reviewed-by: Shrikanth Hegde &lt;sshegde@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260517194931.034728540@kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A large portion of interrupt count entries are zero. There is no point in
formatting the zero value as it is way cheeper to just emit a constant
string.

Collect the number of consecutive zero counts and emit them in one go
before a non-zero count and at the end of the line.

Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Tested-by: Michael Kelley &lt;mhklinux@outlook.com&gt;
Reviewed-by: Dmitry Ilvokhin &lt;d@ilvokhin.com&gt;
Reviewed-by: Radu Rendec &lt;radu@rendec.net&gt;
Reviewed-by: Shrikanth Hegde &lt;sshegde@linux.ibm.com&gt;
Link: https://patch.msgid.link/20260517194931.034728540@kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq/proc: Size interrupt directory names for 10-digit interrupt numbers</title>
<updated>2026-05-11T14:32:30+00:00</updated>
<author>
<name>Pengpeng Hou</name>
<email>pengpeng@iscas.ac.cn</email>
</author>
<published>2026-04-03T08:55:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=c2c7983c93f5d86962318be7e7298f1bc3feb1a6'/>
<id>c2c7983c93f5d86962318be7e7298f1bc3feb1a6</id>
<content type='text'>
/proc/irq/&lt;n&gt;/ directory names are built in `char name[10]` buffers
with `sprintf(name, "%u", irq)`.

Ten-digit IRQ numbers already need 11 bytes including the trailing NUL, and
current sparse-IRQ configurations allow interrupt numbers in that range.

Size the temporary name buffer for the current decimal form and switch
to bounded formatting when creating or removing the proc entry.

Signed-off-by: Pengpeng Hou &lt;pengpeng@iscas.ac.cn&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260404101001.1-genirq-proc-pengpeng@iscas.ac.cn
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
/proc/irq/&lt;n&gt;/ directory names are built in `char name[10]` buffers
with `sprintf(name, "%u", irq)`.

Ten-digit IRQ numbers already need 11 bytes including the trailing NUL, and
current sparse-IRQ configurations allow interrupt numbers in that range.

Size the temporary name buffer for the current decimal form and switch
to bounded formatting when creating or removing the proc entry.

Signed-off-by: Pengpeng Hou &lt;pengpeng@iscas.ac.cn&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260404101001.1-genirq-proc-pengpeng@iscas.ac.cn
</pre>
</div>
</content>
</entry>
<entry>
<title>genirq/proc: Replace snprintf with strscpy in register_handler_proc</title>
<updated>2026-01-30T07:53:53+00:00</updated>
<author>
<name>Thorsten Blum</name>
<email>thorsten.blum@linux.dev</email>
</author>
<published>2026-01-27T22:49:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2dfc417414c6eea4e167b2f46283cded846c531a'/>
<id>2dfc417414c6eea4e167b2f46283cded846c531a</id>
<content type='text'>
Replace snprintf("%s", ...) with the faster and more direct strscpy().

Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260127224949.441391-2-thorsten.blum@linux.dev
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace snprintf("%s", ...) with the faster and more direct strscpy().

Signed-off-by: Thorsten Blum &lt;thorsten.blum@linux.dev&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@kernel.org&gt;
Link: https://patch.msgid.link/20260127224949.441391-2-thorsten.blum@linux.dev
</pre>
</div>
</content>
</entry>
</feed>
