Re:Designing a kernel to be preemptible
Posted: Thu May 12, 2005 3:40 am
Hi,
For some devices (like serial ports, parallel ports and the PS/2 keyboard) if the device doesn't get attention soon enough you end up with buffer overflows and lost data. For other devices (like IDE/hard drive and floppy drive controllers) if the device doesn't get attention for ages it doesn't really matter much - you might get worse transfer speeds but you won't lose data or anything. The whole idea of the IRQ priorities is to make sure that higher priority devices get the attention they need before lower priority devices get any attention. What's important is the order that devices receive attention - how this is acheived doesn't matter much (whether it's a result of thread priorities and "pre-EOI", or PIC/APIC priorities and "post-EOI).
IMHO it's not unreasonable to expect all IRQ handlers to send an EOI (or an "unmask me please") in a timely manner. If a device driver fails to do this you end up with problems - at least one device stops working (I agree that with "post-EOI" the problems are more severe). In practice this sort of failure won't make it into completed drivers, and you can use some sort of timer to terminate the driver or generate an error if the EOI (or the "unmask me please") takes too long.
Cheers,
Brendan
It does make sense, and your are correct. First let's make up some names: "pre-EOI" for masking the IRQ, sending the EOI, handling the device/s and then unmasking the IRQ, and "post-EOI" for handling the device/s and then sending the EOI.Colonel Kernel wrote:Does this make sense, or am I making a bad assumption about the 8259A's priority scheme?
For some devices (like serial ports, parallel ports and the PS/2 keyboard) if the device doesn't get attention soon enough you end up with buffer overflows and lost data. For other devices (like IDE/hard drive and floppy drive controllers) if the device doesn't get attention for ages it doesn't really matter much - you might get worse transfer speeds but you won't lose data or anything. The whole idea of the IRQ priorities is to make sure that higher priority devices get the attention they need before lower priority devices get any attention. What's important is the order that devices receive attention - how this is acheived doesn't matter much (whether it's a result of thread priorities and "pre-EOI", or PIC/APIC priorities and "post-EOI).
IMHO it's not unreasonable to expect all IRQ handlers to send an EOI (or an "unmask me please") in a timely manner. If a device driver fails to do this you end up with problems - at least one device stops working (I agree that with "post-EOI" the problems are more severe). In practice this sort of failure won't make it into completed drivers, and you can use some sort of timer to terminate the driver or generate an error if the EOI (or the "unmask me please") takes too long.
Cheers,
Brendan