Date: Wed, 30 Apr 2003 13:52:35 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: Andrew Gallatin <gallatin@cs.duke.edu> Cc: freebsd-arch@FreeBSD.ORG Subject: Re: lots of malloc(M_WAITOK)'s in interrupt context from camisr Message-ID: <XFMail.20030430135235.jhb@FreeBSD.org> In-Reply-To: <16047.59314.532227.475952@grasshopper.cs.duke.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20030430135235.jhb>