Interrupt threads

Greg 'groggy' Lehey grog at FreeBSD.org
Tue Apr 22 19:50:53 PDT 2003


On Tuesday, 22 April 2003 at 17:49:03 -0400, Aniruddha Bohra wrote:
> Hello
>    Reading the implementation of interrupt handling on i386,
> and reading Greg Lehey's Usenix paper on FreeBSD 5.0 SMP
> implementation, I understand that interrupt handling is done in
> process context. This is needed partly to support sleeping while
> handling the interrupt because GIANT needs to be locked and
> a sleep is possible there.
>
>    My question is after all subsystems that lock giant are made
> INTR_MPSAFE will the implementation go back to non-process
> context interrupt handling (as in older versions) ?

No.  INTR_MPSAFE means that the ISRs use their own locking scheme.
They can still sleep.

>    Moreover, will the locking be per-IRQ or there will be a global
> IRQ lock for ensuring atomic access to the ISRs ?

No.  The locks will be finer grained, generally per device, not per
IRQ.

>    Finally why do we need to create a kernel thread for each IRQ -
> why can't one kernel thread handle all the IRQs ?

If the kernel thread sleeps on one lock, everything would stop.  Even
if you accept that you're only processing one interrupt at a time, I
can't think of a way to do this without instant deadlock.  That's the
whole point of having the threads in the first place.

Greg
--
When replying to this message, please copy the original recipients.
If you don't, I may ignore the reply or reply to the original recipients.
For more information, see http://www.lemis.com/questions.html
See complete headers for address and phone numbers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20030423/1ca949a9/attachment.bin


More information about the freebsd-questions mailing list