From owner-freebsd-arch@FreeBSD.ORG Wed Apr 30 10:57:08 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8186137B401 for ; Wed, 30 Apr 2003 10:57:08 -0700 (PDT) Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA06443FA3 for ; Wed, 30 Apr 2003 10:57:05 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 23660 invoked from network); 30 Apr 2003 17:52:39 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 30 Apr 2003 17:52:39 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h3UHqTOv022272; Wed, 30 Apr 2003 13:52:30 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <16047.59314.532227.475952@grasshopper.cs.duke.edu> Date: Wed, 30 Apr 2003 13:52:35 -0400 (EDT) From: John Baldwin To: Andrew Gallatin cc: freebsd-arch@FreeBSD.ORG Subject: Re: lots of malloc(M_WAITOK)'s in interrupt context from camisr X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Apr 2003 17:57:08 -0000 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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/