From owner-freebsd-current@FreeBSD.ORG Tue Mar 17 14:57:40 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 C378E10657E3; Tue, 17 Mar 2009 14:57:40 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from mail0.tomato.it (mail0.tomato.it [213.92.0.53]) by mx1.freebsd.org (Postfix) with SMTP id 289C78FC15; Tue, 17 Mar 2009 14:57:29 +0000 (UTC) (envelope-from p.pisati@oltrelinux.com) Received: from ferret.tomato.lan (fast.tomato.it [62.101.64.91]) by mail0.tomato.it (Postfix) with ESMTP id 84CDD2842E; Tue, 17 Mar 2009 15:29:43 +0100 (CET) Message-ID: <49BFB340.9050909@oltrelinux.com> Date: Tue, 17 Mar 2009 15:27:12 +0100 From: Paolo Pisati User-Agent: Thunderbird 2.0.0.16 (X11/20080815) MIME-Version: 1.0 To: Robert Watson References: <929422.83072.qm@web63908.mail.re1.yahoo.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Barney Cordoba , 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 14:57:46 -0000 Robert Watson wrote: > > On Fri, 13 Mar 2009, Barney Cordoba wrote: > >> Can you clarify the difference between using a fast irq and then >> launching a thread (as em does) versus using an MPSAFE interrupt as >> most other drivers (particularly bge and ibg) use? >> >> How do they differ in terms of how they are called and executed? > > I agree that the code there looks inconsistent in when it uses fast vs > regular mpsafe interrupts, Scott may be able to shed more light on > this. I'm especially confused by: > > #if __FreeBSD_version < 700000 > if ((error = bus_setup_intr(dev, adapter->res[0], > INTR_TYPE_NET | INTR_FAST, em_irq_fast, adapter, > #else > if ((error = bus_setup_intr(dev, adapter->res[0], > INTR_TYPE_NET, em_irq_fast, NULL, adapter, > #endif > > This is in what I took to be the INTR_FAST registration, so I would > expect also to see INTR_FAST in the mask for that second bit. 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. -- bye, P.