Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an interrupt handler be preempted by the same interrupt handler?

Does the CPU disable all interrupts on local CPU before calling the interrupt handler? Or does it only disable that particular interrupt line, which is being served?

like image 211
Harman Avatar asked Jul 09 '12 22:07

Harman


1 Answers

x86 disables all local interrupts (except NMI of course) before jumping to the interrupt vector. Linux normally masks the specific interrupt and re-enables the rest of the interrupts (which aren't masked), unless a specific flags is passed to the interrupt handler registration.

Note that while this means your interrupt handler will not race with itself on the same CPU, it can and will race with itself running on other CPUs in an SMP / SMT system.

like image 147
gby Avatar answered Sep 24 '22 18:09

gby