lots of malloc(M_WAITOK)'s in interrupt context from camisr

John Baldwin jhb at FreeBSD.org
Wed Apr 30 10:57:08 PDT 2003


On 30-Apr-2003 Andrew Gallatin wrote:
> 
> John Baldwin writes:
> 
>  > If you need to do more work in your interrupt routine than just wakeups
>  > and dinking with registers, you can always wake up a software interrupt
>  > handler or some other random kthread to do things that take a long amount
> 
> Dumb question: Exactly what is one allowed to do in an INTR_FAST
> interrupt context?  Obviously, you can't sleep.  But can you call
> wakeup()?

You can call wakeup() so long as you ensure that it won't be missed.
Since you can only call msleep() with a sleep mutex, then you would
normally need a sleep mutex (which you can't grab in a fast handler)
to hold across the call to wakeup() to avoid missing the wakeup().
Since you can't do that, you could have your msleep() use a timeout
value, in which case missing a wakeup isn't fatal.

-- 

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-arch mailing list