From owner-freebsd-arch@FreeBSD.ORG Wed Apr 30 08:52:26 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 DFA8537B401 for ; Wed, 30 Apr 2003 08:52:26 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00B6143F93 for ; Wed, 30 Apr 2003 08:52:26 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h3UFqKA7098112; Wed, 30 Apr 2003 09:52:20 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Wed, 30 Apr 2003 09:52:15 -0600 (MDT) Message-Id: <20030430.095215.48529965.imp@bsdimp.com> To: phk@phk.freebsd.dk From: "M. Warner Losh" In-Reply-To: <12432.1051717236@critter.freebsd.dk> References: <16047.59842.60959.352839@grasshopper.cs.duke.edu> <12432.1051717236@critter.freebsd.dk> X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: gallatin@cs.duke.edu 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 15:52:27 -0000 In message: <12432.1051717236@critter.freebsd.dk> "Poul-Henning Kamp" writes: : In message <16047.59842.60959.352839@grasshopper.cs.duke.edu>, Andrew Gallatin : writes: : > : >Poul-Henning Kamp writes: : > > In message <16047.59314.532227.475952@grasshopper.cs.duke.edu>, Andrew Gallatin : > > writes: : > > > : > > >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()? : > > : > > Calling wakeup() is just about it, but we should actually define it : > > more precisely in a suitable man-page. : > : >That would be cool. Since wakeup() uses a spinlock, I assume that : >spinlocks are generally OK too.. : : I'm not sure you should infer too much yet... Yes. A spinlock in the context of wakeup being safe might be radically different than spinlocks generally being safe. I'm not sure that wakeup is safe in a fast interrupt context even. I've always had to create a soft interrupt and call the sched routine to get it to run. We definitely need to document what's allowed in a fast interrupt handler. Generally as little as possible to placate the hardware and the 'expensive' parts of the driver should be in a soft interrupt thread. Warner