Question about interrupt threads

John Baldwin jhb at FreeBSD.org
Thu Apr 24 11:21:16 PDT 2003


On 24-Apr-2003 Aniruddha Bohra wrote:
> Hello
>     Thanks for your answer. I have some questions though
> 
>>>   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) ?
>>>    
>>>
>>
>>I would like that, but don't see how it could work right.
>>  
>>
> Provided all ISRs spin on their locks, and do not sleep, we can assume the
> critical section to be small enough as to not allow interrupt handlers 
> on other CPUs
> to spin for a long time. Then, the problem does go away. Or am I missing
> something important here ? Understandably while there is a GIANT lock
> protecting ISRs, this is not possible.

Our default mutex locks are not spin-only.  Instead, when a thread
contends for a lock, it is suspended.  It's priority is propagated to
the holder of the lock, and the thread will resume when the lock is
released.  In order to not suspend the thread that got interrupted, we
give each interrupt source it's own thread context to execute its
handlers in.

-- 

John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


More information about the freebsd-smp mailing list