Reputation: 11
This is from a Linux Device Driver course I am doing online. It seemed wrong and I wanted to make sure .... "Kernel code running in process context is preemptible. Interrupt context however, runs to completion and is not preemptible."
I thought there could always be higher priority interrupts that could preempt and would have to serviced earlier than the current interrupt ? Or does this have to do with top and bottom halves ? ie the top half runs to completion ?
Upvotes: 1
Views: 245
Reputation: 5280
Some architectures do support interrupt preemption, take ARM's GIC for example if a higher priority interrupt wants to preempt an active but lower priority, it will
But Linux doesn't really support this feature, because it will disable all IRQ on the top half of ISR, which means though higher priority interrupts come, the CPU cannot ack any of them, so it has no way to handle it until the top half has done. That's why the top half should always be short and can never sleep. If you have slow things to do, just put them in the bottom halves, like workqueue, tasklet or else.
Upvotes: 1