Threaded interrupt handlers
Not all interrupts are triggers for the real-time tasks but all interrupts steal cycles from the real-time task. Threaded interrupt handlers allow a priority to be associated with the interrupt and for it to be scheduled at an appropriate time as shown in the following diagram:
If the interrupt handler code is run as a kernel thread there is no reason why it cannot be preempted by a user space thread of higher priority, and so the interrupt handler does not contribute towards scheduling latency of the user space thread. Threaded interrupt handlers have been a feature of mainline Linux since 2.6.30. You can request that an individual interrupt handler is threaded by registering it with request_threaded_irq()
in place of the normal request_irq()
. You can make threaded IRQs the default by configuring the kernel with CONFIG_IRQ_FORCED_THREADING=y
which makes all handlers into threads unless they have explicitly prevented this by setting the IRQF_NO_THREAD
flag. When...