From owner-freebsd-current@FreeBSD.ORG Tue Mar 17 20:41:52 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EEDA1065675 for ; Tue, 17 Mar 2009 20:41:52 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 0D44B8FC17 for ; Tue, 17 Mar 2009 20:41:51 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from trouble.errno.com (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id n2HKfpHr081835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Mar 2009 13:41:51 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <49C00B0E.4030402@freebsd.org> Date: Tue, 17 Mar 2009 13:41:50 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.18 (X11/20081209) MIME-Version: 1.0 To: barney_cordoba@yahoo.com References: <270142.53274.qm@web63902.mail.re1.yahoo.com> In-Reply-To: <270142.53274.qm@web63902.mail.re1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-x.dcc-servers-Metrics: ebb.errno.com; whitelist Cc: current@freebsd.org Subject: Re: Interrupt routine usage not shown by top in 8.0 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Mar 2009 20:41:53 -0000 Barney Cordoba wrote: > > > --- On Tue, 3/17/09, Robert Watson wrote: > > >> From: Robert Watson >> Subject: Re: Interrupt routine usage not shown by top in 8.0 >> To: "Paolo Pisati" >> Cc: "Barney Cordoba" , current@freebsd.org >> Date: Tuesday, March 17, 2009, 11:24 AM >> On Tue, 17 Mar 2009, Paolo Pisati wrote: >> >> >>> perhaps i misunderstood your question, but i'll >>> >> try to explain a bit: >> >>> before 7.0, bus_setup_intr() took just one function >>> >> thus you could have an INTR_FAST or an INTR_MPSAFE handler, >> and you choose the kind of handler via a flag (INTR_FAST in >> this case). >> >>> after 7.0, bus_setup_intr() took 2 functions, thus you >>> >> could have: a fast handler (aka filter), or an ithread >> handler (aka mpsafe), or a fast + ithread handler (available >> only with INTR_FILTER turned on). >> >>> in bus_setup_intr() the first function pointer is for >>> >> the filter side of the handler, while the second pointer is >> for the ithread part, and if you declare both you can filter >> events (interrupts) and call the rest of the device driver >> (the ithread part) after the filter has recognized and >> acknowledged&masked the interrupt. >> >> This clarifies my misunderstanding, thanks! >> >> > > I'd still be interested in knowing the specific advantage/consequences > of a fast filter vs an MPSAFE ithread? > > In what circumstance would using a filter and then launching a task be > advantageous over just using an ithread? > It mostly depends on the hardware (unless the fast handler does actual work). If ack'ing the interrupt improves latency (e.g. by allowing the device to do other things) then it's better to do that in the filter method even if the actual work is deferred to the ithread. It's also important when interrupts are not edge-triggered; you want to shut them up asap. So, what device are you doing a driver for? Sam