USB interrupts

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

User avatar
raboof
Established Member
Posts: 1865
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 52 times
Been thanked: 80 times
Contact:

USB interrupts

Post by raboof »

How do I find out which interrupt is associated with which USB bus?

Code: Select all

$ cat /proc/interrupts | grep usb
 16:     881372          0          0          0          0          0          0          0   IO-APIC-fasteoi   mmc0, ehci_hcd:usb3, nouve
 23:        393          0          0          0          0          0          0          0   IO-APIC-fasteoi   ehci_hcd:usb4
[/quote]
This looks like some of my USB ports are on interrupt 16, and some are on interrupt 23, which is much less crowded. How do I find out which bus to connect my USB sound card?

(OK, I basically already found out by trial and error, but would still like to know how to find out properly :) )
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: USB interrupts

Post by Capoeira »

raboof wrote:
(OK, I basically already found out by trial and error, but would still like to know how to find out properly :) )
only way man. never seen usb port which was numbered. only on the motherboard you could see
User avatar
raboof
Established Member
Posts: 1865
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 52 times
Been thanked: 80 times
Contact:

Re: USB interrupts

Post by raboof »

Capoeira wrote:
raboof wrote:(OK, I basically already found out by trial and error, but would still like to know how to find out properly :) )
only way man. never seen usb port which was numbered. only on the motherboard you could see
Ah, no, that's not what I meant: I can see on which bus my USB device is with lsusb:

Code: Select all

$ lsusb | grep EDIROL
Bus 001 Device 002: ID 0582:00e6 Roland Corp. EDIROL UA-25EX (Advanced mode)
So it's on bus 1 now - what I'm asking about is how to find out whether bus 1 is driven by ehci_hcd:usb3 or ehci_hcd:usb4.
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: USB interrupts

Post by Capoeira »

well normaly ehci_hcd:usb3 would be Bus 3 but since you don't have ehci_hcd:usb1 and 2 (did you disable them in Bios?) ehci_hcd:usb3 will probably be Bus1
User avatar
Capoeira
Established Member
Posts: 1321
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil
Has thanked: 3 times
Been thanked: 2 times

Re: USB interrupts

Post by Capoeira »

one way to be shure is to check CPU usage in htop
you should have CPU usage on ehci_hcd:usb3 when the card is used
deufrai
Established Member
Posts: 29
Joined: Thu Dec 13, 2012 6:38 pm
Location: Paris, France
Contact:

Re: USB interrupts

Post by deufrai »

Hi guys

Answered here :

http://linuxmusicians.com/viewtopic.php ... =911#p4382

Look for the first device of the bus you're looking for in the output of 'sudo lsusb -v' and look for the 'iSerial' value
then match this id against the output of 'lspci -v' to get your USB Bus IRQ

In here with a FastTrack PRO

Code: Select all

$ lsusb | grep Fast
Bus 002 Device 004: ID 0763:2012 Midiman M-Audio Fast Track Pro
Bus is 2

then browse your usb infos for the first device on that bus and lookup iSerial

Code: Select all

$ sudo lsusb -v
...
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
...
  iSerial                1 0000:00:1d.0
...
iSerial = 00:1d.0

Then look it up on your pci infos

Code: Select all

$ lspci -v | grep -A 10 '00:1d.0'
00:1d.0 USB controller: Intel Corporation 6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 (rev 05) (prog-if 20 [EHCI])
	Subsystem: Hewlett-Packard Company Device 1659
	Flags: bus master, medium devsel, latency 0, IRQ 20
	Memory at c7509000 (32-bit, non-prefetchable) [size=1K]
	Capabilities: <access denied>
	Kernel driver in use: ehci_hcd
IRQ = 20

Hope this works on your end
Think, it ain't illegal yet
And use Qrest, it won't hurt : http://www.qrest.org

Ubuntu 12.04 + full KXStudio on an HP Pavilion dv7-6c70ef
Usually make noise with a Warwick $$ 5 strings bass hooked to a zoom B9.1ut and an M-Audio FastTrack PRO
User avatar
raboof
Established Member
Posts: 1865
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 52 times
Been thanked: 80 times
Contact:

Re: USB interrupts

Post by raboof »

deufrai wrote:Look for the first device of the bus you're looking for in the output of 'sudo lsusb -v' and look for the 'iSerial' value then match this id against the output of 'lspci -v' to get your USB Bus IRQ
Ah yes, perfect!

So the next step: for my USB 3.0 hub, lspci reports interrupt 18 and kernel driver xhci_hcd:

Code: Select all

0e:00.0 USB controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04) (prog-if 30 [XHCI])
        Interrupt: pin A routed to IRQ 18
        Kernel driver in use: xhci_hcd[/code
However, /proc/interrupts shows this module on higher interrupts instead:
[code]$ grep xhci_hcd /proc/interrupts
 42:         37          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 43:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 44:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 45:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 46:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 47:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 48:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 49:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
How do I find out which of these is used by my soundcard?

And then the next step: I see only 8 ksoftirqd processes. How does that work? Do they handle multiple interrupts? How do I find out which one is handling which interrupts?
deufrai
Established Member
Posts: 29
Joined: Thu Dec 13, 2012 6:38 pm
Location: Paris, France
Contact:

Re: USB interrupts

Post by deufrai »

well, you already found out. It's IRQ 18

confirm it with

Code: Select all

$ grep '18:' /proc/interrupts
Think, it ain't illegal yet
And use Qrest, it won't hurt : http://www.qrest.org

Ubuntu 12.04 + full KXStudio on an HP Pavilion dv7-6c70ef
Usually make noise with a Warwick $$ 5 strings bass hooked to a zoom B9.1ut and an M-Audio FastTrack PRO
User avatar
raboof
Established Member
Posts: 1865
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 52 times
Been thanked: 80 times
Contact:

Re: USB interrupts

Post by raboof »

deufrai wrote:well, you already found out. It's IRQ 18

confirm it with

Code: Select all

$ grep '18:' /proc/interrupts
That's the strange thing: it's really not there:

Code: Select all

$ cat /proc/interrupts | grep 18:
 18:          0          0          0          0          0          0          0          0   IO-APIC-fasteoi   i801_smbus
deufrai
Established Member
Posts: 29
Joined: Thu Dec 13, 2012 6:38 pm
Location: Paris, France
Contact:

Re: USB interrupts

Post by deufrai »

Beats me !

I'm not really good at hardware, and surely am puzzled by this output.
Let's see if some big guy in here has a clue ...
Think, it ain't illegal yet
And use Qrest, it won't hurt : http://www.qrest.org

Ubuntu 12.04 + full KXStudio on an HP Pavilion dv7-6c70ef
Usually make noise with a Warwick $$ 5 strings bass hooked to a zoom B9.1ut and an M-Audio FastTrack PRO
User avatar
raboof
Established Member
Posts: 1865
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 52 times
Been thanked: 80 times
Contact:

Re: USB interrupts

Post by raboof »

raboof wrote:I see only 8 ksoftirqd processes. How does that work? Do they handle multiple interrupts? How do I find out which one is handling which interrupts?
Ah, I'm seeing 8 ksoftirqd processes because you get a ksoftirqd per core, not per thread, it seems. To get a thread per IRQ handler I guess I should use the 'threadirqs' option - maybe later.
Гага́рин
Established Member
Posts: 48
Joined: Tue Jan 01, 2013 3:12 pm

Re: USB interrupts

Post by Гага́рин »

why all your irqs are stuck on a single core? It should look something like this:

Code: Select all

73:       7983       7852       7992       7959   PCI-MSI-edge      xhci_hcd
Гага́рин
Established Member
Posts: 48
Joined: Tue Jan 01, 2013 3:12 pm

Re: USB interrupts

Post by Гага́рин »

raboof wrote: How do I find out which of these is used by my soundcard?
paste ALL your /proc/interrupts
User avatar
raboof
Established Member
Posts: 1865
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 52 times
Been thanked: 80 times
Contact:

Re: USB interrupts

Post by raboof »

Гага́рин wrote:why all your irqs are stuck on a single core? It should look something like this:

Code: Select all

73:       7983       7852       7992       7959   PCI-MSI-edge      xhci_hcd
You tell me....
User avatar
raboof
Established Member
Posts: 1865
Joined: Tue Apr 08, 2008 11:58 am
Location: Deventer, NL
Has thanked: 52 times
Been thanked: 80 times
Contact:

Re: USB interrupts

Post by raboof »

Гага́рин wrote:
raboof wrote: How do I find out which of these is used by my soundcard?
paste ALL your /proc/interrupts
Here ya go:

Code: Select all

arnouten@jaga:~$ cat /proc/interrupts 
           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
  0:        126          0          0          0          0          0          0          0   IO-APIC-edge      timer
  1:       2208          0          0          0          0          0          0          0   IO-APIC-edge      i8042
  8:          1          0          0          0          0          0          0          0   IO-APIC-edge      rtc0
  9:     153519          0          0          0          0          0          0          0   IO-APIC-fasteoi   acpi
 12:       7850          0          0          0          0          0          0          0   IO-APIC-edge      i8042
 16:       1006          0          0          0          0          0          0          0   IO-APIC-fasteoi   mmc0, ehci_hcd:usb3, nouveau
 17:        399          0          0          0          0          0          0          0   IO-APIC-fasteoi   snd_hda_intel
 18:          0          0          0          0          0          0          0          0   IO-APIC-fasteoi   i801_smbus
 19:         38          0          0          0          0          0          0          0   IO-APIC-fasteoi   firewire_ohci
 23:        398          0          0          0          0          0          0          0   IO-APIC-fasteoi   ehci_hcd:usb4
 41:      27201          0          0          0          0          0          0          0   PCI-MSI-edge      eth1
 42:          1          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 43:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 44:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 45:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 46:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 47:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 48:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 49:          0          0          0          0          0          0          0          0   PCI-MSI-edge      xhci_hcd
 50:     410567          0          0          0          0          0          0          0   PCI-MSI-edge      ahci
 51:         25          0          0          0          0          0          0          0   PCI-MSI-edge      mei
 52:    1682788          0          0          0          0          0          0          0   PCI-MSI-edge      iwlwifi
 53:     345658          0          0          0          0          0          0          0   PCI-MSI-edge      snd_hda_intel
NMI:       4988       3036       4504       2800       4392       2789       4347       2790   Non-maskable interrupts
LOC:   10565654    5110660    9758055    4013266    9957097    3981099    9983890    3995432   Local timer interrupts
SPU:          0          0          0          0          0          0          0          0   Spurious interrupts
PMI:       4988       3036       4504       2800       4392       2789       4347       2790   Performance monitoring interrupts
IWI:          0          0          0          0          0          0          0          0   IRQ work interrupts
RTR:          7          0          0          0          0          0          0          0   APIC ICR read retries
RES:    4703524    2331610     112434      22839      66254      14684      58622      14419   Rescheduling interrupts
CAL:        959       1442       1285       1429       1346       1464       1423       1466   Function call interrupts
TLB:      48120       4600      55976       2540      33599       3255      36477       4940   TLB shootdowns
TRM:          0          0          0          0          0          0          0          0   Thermal event interrupts
THR:          0          0          0          0          0          0          0          0   Threshold APIC interrupts
MCE:          0          0          0          0          0          0          0          0   Machine check exceptions
MCP:        183        183        183        183        183        183        183        183   Machine check polls
ERR:          2
MIS:          0
arnouten@jaga:~$ 
Post Reply