Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Mar 2009 16:03:22 -0700 (PDT)
From:      Barney Cordoba <barney_cordoba@yahoo.com>
To:        Sam Leffler <sam@freebsd.org>
Cc:        current@freebsd.org
Subject:   Re: Interrupt routine usage not shown by top in 8.0
Message-ID:  <914146.31317.qm@web63901.mail.re1.yahoo.com>
In-Reply-To: <49C00B0E.4030402@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help




--- On Tue, 3/17/09, Sam Leffler <sam@freebsd.org> wrote:

> From: Sam Leffler <sam@freebsd.org>
> Subject: Re: Interrupt routine usage not shown by top in 8.0
> To: barney_cordoba@yahoo.com
> Cc: current@freebsd.org
> Date: Tuesday, March 17, 2009, 4:41 PM
> Barney Cordoba wrote:
> > 
> > 
> > --- On Tue, 3/17/09, Robert Watson
> <rwatson@FreeBSD.org> wrote:
> > 
> >   
> >> From: Robert Watson <rwatson@FreeBSD.org>
> >> Subject: Re: Interrupt routine usage not shown by
> top in 8.0
> >> To: "Paolo Pisati"
> <p.pisati@oltrelinux.com>
> >> Cc: "Barney Cordoba"
> <barney_cordoba@yahoo.com>, 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

I'm working with the igb and ixgbe drivers. Neither of them
use the filters, but em does. Since they are all maintained
by the same person I was curious as to why the em used filters
and the igb and ixgbe, which are supposedly higher performance
cards, use MPSAFE ithreads. 

Barney


      



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?914146.31317.qm>