FreeBSD spinlock - compatibility layer

John Baldwin jhb at freebsd.org
Tue May 21 19:02:11 UTC 2013


On Tuesday, May 21, 2013 12:36:38 am Orit Moskovich wrote:
> That's not the case when using taskqueues for deferring  execution of an 
interrupt handler.
> Tasks can be delayed using the global taskqueue taskqueue_swi, which 
executes its tasks in the context of an interrupt.
> In this case sleep is forbidden, and using spin mutex is not (although might 
be not recommended).

No, swi's run in an interrupt thread, and interrupt threads can use regular 
mutexes.  (That is why they run in a thread context.)  The only way you can 
run in a context requiring a spin lock in a driver is to use an interrupt 
filter.

-- 
John Baldwin


More information about the freebsd-arch mailing list