Linux – What does `/proc/irq/…/spurious` contain

driversinterruptlinuxprocess

Here is the output from cat /proc/irq/79/spurious:

count 28
unhandled 0
last_unhandled 0 ms

What are these parameters indicating here — count, last_unhandled? Is this count indicating the number of times this interrupt did not get noticed?

Best Answer

count gives the total number of times the IRQ fired, modulo 100,000; spurious gives the number of unhandled events in recent memory; and last_unhandled stores the jiffies at which the last unhandled event occurred (displayed in milliseconds since the kernel booted).

The purpose of these is to track spurious interrupts and allow them to be taken into account if they occur too frequently. When a spurious interrupt occurs, the current time (in jiffies) is compared with the last unhandled time, and the spurious counter is only incremented if the previous spurious interrupt was recent enough. So occasional spurious interrupts won’t affect the system, whereas frequent spurious interrupts will eventually result in the IRQ being disabled (along with a message in the kernel logs):

If 99,900 of the previous 100,000 interrupts have not been handled then assume that the IRQ is stuck in some manner. Drop a diagnostic and try to turn the IRQ off.

Related Question