In Linux Kernel Development book (Robert Love), It is mentioned that :
we must disable local interrupts before obtaining spinlock in interrupt handler. Otherwise it is possible for an interrupt handler to interrupt kernel code while the lock is held and attempt to re-acquire the lock. Which finally can lead to double-acquire deadlock.
Now my doubt is:
- In general, doesn't
do_IRQ()
disables local interrupt ? - And if lock is acquire, it means that
preempt_count
variable is not zero, which makes that no other handler should get chance, as kernel is notpreempt_safe
. So how other interrupt handler can work in this situation ?