且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

一个中断处理程序可以被同一个中断处理程序抢占吗?

更新时间:2023-11-22 19:07:28

x86 在跳转到中断向量之前禁用所有本地中断(当然 NMI 除外).Linux 通常会屏蔽特定的中断并重新启用其余的中断(未屏蔽),除非将特定标志传递给中断处理程序注册.

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.

请注意,虽然这意味着您的中断处理程序不会在同一个 CPU 上与自身竞争,但它可以并且将会与在 SMP/SMT 系统中的其他 CPU 上运行的自身竞争.

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.