Interrupt Descriptions

John Baldwin jhb at freebsd.org
Wed Oct 14 15:00:46 UTC 2009


On Wednesday 14 October 2009 3:18:04 am Alexander Motin wrote:
> John Baldwin wrote:
> > On Wednesday 30 September 2009 5:32:20 pm John Baldwin wrote:
> >> A few folks have asked recently for the ability to add descriptive strings 
> > to 
> >> registered interrupt handlers.  This is especially true since the advent of 
> >> MSI with multiple interrupts per device.  I hacked up a prototype today that 
> >> adds a new 'bus_describe_intr()' that takes the IRQ resource, the void * 
> >> cookie returned by bus_setup_intr() and var args description and appends 
> > that 
> >> to the interrupt name in the thread and vmstat -i info.  The current patch 
> >> only has the MI bits and the MD bits for amd64 as well as a sample change to 
> >> the igb(4) driver.
> >>
> >> The patch is at http://www.FreeBSD.org/~jhb/patches/intr_describe.patch.
> >>
> >> An example from this patch is:
> >>
> >>> vmstat -i
> >> interrupt                          total       rate
> >> irq1: atkbd0                           8          0
> >> irq4: uart0                          751          5
> >> irq6: fdc0                             6          0
> >> irq14: ata0                           36          0
> >> irq20: uhci0                          20          0
> >> irq23: uhci3 ehci0                     2          0
> >> irq28: mpt0                         1661         11
> >> irq256: igb0:tx 0                    880          6
> >> irq257: igb0:rx 0                   1098          7
> >> irq258: igb0:link                      3          0
> >> irq259: igb1:tx 0                      1          0
> >> irq260: igb1:rx 0                    134          0
> >> irq261: igb1:link                      3          0
> > 
> > Do folks feel that the issues with the intrnames and intrcnt API warrant
> > delaying this work, or do folks have any objections to the proposed
> > bus_describe_intr() API?  Personally I think that intrnames and intrcnt are
> > certainly broken, but that they have been broken for quite a while and that
> > these changes do not make them more broken than they currently are.  Also, I
> > think that any fixes to intrcnt/intrnames would be orthogonal to
> > bus_describe_intr().
> 
> Just some 50 cents on topic: it would be nice if `vmstat -i` was able to
> show all (more then 2) consumers of shared interrupt instead of "cbb0
> wpi0+". I haven't looked who actually limit this and why, so it's just a
> wish.

At the moment the limit comes from stuffing the name into a p_comm[] (or in
8+ td_name[]) array which is limited to MAXCOMLEN in length.  We also reuse
that same name for the interrupt name in vmstat -i.  Note that in 4.x before
ithreads if you had a shared interrupt the vmstat -i output just said "mux"
(check vmstat -i on ref4 for irq2) and did not tell you any of the devices at
all, so a partial list is at least better than no list.  We could generate a
separate interrupt name for vmstat -i vs the ithread name, it's just a matter
of space.  We might do this if we move away from having static ithreads (i.e.
having a pool of ithreads that are a specialized taskqueue that execute
interrupt events).  In that case the name would no longer be used for threads
at all, so it could just be made longer, or possibly dynamically allocated.

-- 
John Baldwin


More information about the freebsd-arch mailing list