How much RT optimization is still needed?

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

User avatar
turbidh20
Established Member
Posts: 190
Joined: Sun Aug 04, 2019 12:48 pm
Location: UK
Has thanked: 8 times
Been thanked: 2 times

Re: How much RT optimization is still needed?

Post by turbidh20 »

I think I stopped using swap when I went from 2 to 4 GB RAM around 11 years ago! I currently have 16. Definitely use it as an insurance policy though if you feel the need. No harm in that at all :D
Arch Linux (i7-4790k/GTX970); UMC204HD; MPK Mini MKII; Jack2 (QjackCtl) & Ardour/Mixbus
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: How much RT optimization is still needed?

Post by merlyn »

turbidh20 wrote:to clarify - using xhci puts all 9 USB 3 IRQs at the top! This would appear to be a drawback
If you get less Xruns it doesn't seem to be a drawback. Are your other USB devices on 'ehci'?

Your experience would suggest rtirq can go into the 'essential' category of tweaks.
User avatar
turbidh20
Established Member
Posts: 190
Joined: Sun Aug 04, 2019 12:48 pm
Location: UK
Has thanked: 8 times
Been thanked: 2 times

Re: How much RT optimization is still needed?

Post by turbidh20 »

merlyn wrote: Thu Jul 30, 2020 10:40 am
turbidh20 wrote:to clarify - using xhci puts all 9 USB 3 IRQs at the top! This would appear to be a drawback
If you get less Xruns it doesn't seem to be a drawback. Are your other USB devices on 'ehci'?
I use all my USB ports, so I also have stuff on 'ehci' but I don't need to prioritise that as my 204HD is in a USB 3 port.
merlyn wrote: Thu Jul 30, 2020 10:40 am Your experience would suggest rtirq can go into the 'essential' category of tweaks.
Absolutely! I think this is going to be slightly different though, depending on the specific motherboard involved. I'm guessing the USB implementation is highly dependent on MB vendor.

In my case my 204HD is reported to be on IRQ 18 but this appears to be irrelevant as I need xhci prioritised or massive xruns. And then you can't prioritise the order of the IRQs which means I get IRQ 46 at the top, which is powering things like mouse and keyboard. The weird thing is I'm getting IRQ 47 running hottest (above jackd even), so is this the one actually associated with my 204HD? I can find no record of anything attached to IRQ 47! It's all black magic :D

This is my 'rtirq status'...

Code: Select all

    
    PID CLS RTPRIO  NI PRI %CPU STAT COMMAND	
    550 FF      90   - 130  0.0 S    irq/18-i801_smb	
    253 FF      85   - 125  0.1 S    irq/46-xhci_hcd	
    256 FF      84   - 124  3.6 S    irq/47-xhci_hcd	
    257 FF      83   - 123  0.0 S    irq/48-xhci_hcd	
    258 FF      82   - 122  0.0 S    irq/49-xhci_hcd	
    259 FF      81   - 121  0.0 S    irq/50-xhci_hcd	
    260 FF      80   - 120  0.0 S    irq/51-xhci_hcd	
    261 FF      79   - 119  0.0 S    irq/52-xhci_hcd	
    262 FF      78   - 118  0.0 S    irq/53-xhci_hcd	
    263 FF      77   - 117  0.0 S    irq/54-xhci_hcd	
    123 FF      50   -  90  0.0 S    irq/9-acpi	
    141 FF      50   -  90  0.0 S    irq/34-nvme0q0	
    142 FF      50   -  90  0.0 S    irq/36-nvme0q1	
    143 FF      50   -  90  0.0 S    irq/37-nvme0q2	
    144 FF      50   -  90  0.0 S    irq/38-nvme0q3	
    145 FF      50   -  90  0.0 S    irq/39-nvme0q4	
    146 FF      50   -  90  0.0 S    irq/40-nvme0q5	
    147 FF      50   -  90  0.0 S    irq/41-nvme0q6	
    148 FF      50   -  90  0.0 S    irq/42-nvme0q7	
    149 FF      50   -  90  0.0 S    irq/43-nvme0q8	
    150 FF      50   -  90  0.0 S    irq/35-ahci[000	
    166 FF      50   -  90  0.0 S    irq/44-ahci[000	
    173 FF      50   -  90  0.0 S    irq/45-ahci[000	
    180 FF      50   -  90  0.0 S    irq/8-rtc0	
    247 FF      50   -  90  0.0 S    irq/16-firewire	
    248 FF      50   -  90  0.0 S    irq/16-ehci_hcd	
    254 FF      50   -  90  0.0 S    irq/23-ehci_hcd	
    553 FF      50   -  90  0.0 S    irq/56-mei_me	
   1079 FF      50   -  90  0.2 S    irq/57-nvidia	
   1080 FF      49   -  89  0.5 S    irq/57-s-nvidia	
      9 TS       -   0  19  0.1 S    ksoftirqd/0	
     21 TS       -   0  19  0.0 S    ksoftirqd/1	
     28 TS       -   0  19  0.0 S    ksoftirqd/2	
     35 TS       -   0  19  0.0 S    ksoftirqd/3	
     42 TS       -   0  19  0.1 S    ksoftirqd/4	
     49 TS       -   0  19  0.0 S    ksoftirqd/5	
     56 TS       -   0  19  0.1 S    ksoftirqd/6	
     63 TS       -   0  19  0.1 S    ksoftirqd/7	
Arch Linux (i7-4790k/GTX970); UMC204HD; MPK Mini MKII; Jack2 (QjackCtl) & Ardour/Mixbus
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: How much RT optimization is still needed?

Post by merlyn »

I think i801_smb may not have anything to do with your soundcard. Is it the System Management Bus? Have you tried deleting i801_smb in rtirq.conf?
User avatar
turbidh20
Established Member
Posts: 190
Joined: Sun Aug 04, 2019 12:48 pm
Location: UK
Has thanked: 8 times
Been thanked: 2 times

Re: How much RT optimization is still needed?

Post by turbidh20 »

merlyn wrote: Thu Jul 30, 2020 4:09 pm I think i801_smb may not have anything to do with your soundcard. Is it the System Management Bus? Have you tried deleting i801_smb in rtirq.conf?
I mentioned it in a previous post :) It appears to work the same whether it's in or not, as long as xhci is in.

The only reason I've left it in is because my card is assigned to its IRQ - 18. Like I said, it's all voodoo!
Arch Linux (i7-4790k/GTX970); UMC204HD; MPK Mini MKII; Jack2 (QjackCtl) & Ardour/Mixbus
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: How much RT optimization is still needed?

Post by merlyn »

turbidh20 wrote: The only reason I've left it in is because my card is assigned to its IRQ - 18.
Where are you getting that? If I use cat /proc/interrupts it doesn't tell me what devices are on the USB bus. If you have JACK running then yes, the interrupt at the top is the soundcard. top shows this :

Code: Select all

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                               
    363 root     -96   0       0      0      0 S   6.3   0.0   0:02.80 irq/20-snd_ice1                                                                                       
   8597 merlyn    20   0  248684  96368  88820 S   5.3   0.9   0:02.49 jackdbus                                                                                              
      9 root      20   0       0      0      0 R   2.0   0.0   0:19.18 ksoftirqd/0                                                                                           
   1264 merlyn    20   0 1087772 125276  81872 S   0.7   1.1   3:03.28 Xorg                                                                                                  
   5532 merlyn    20   0 2786848 314364 117852 S   0.7   2.8   1:58.49 Web Content                                                                                           
   5581 merlyn    20   0 2770776 297888 153372 S   0.7   2.7   2:13.52 Web Content                                                                                           
    370 root     -51   0       0      0      0 S   0.3   0.0   0:31.80 irq/30-radeon 
The lower the JACK buffer the higher the CPU for the interrupt. The terminal output above is with only JACK running with a buffer size of 16 -- no JACK apps and it's already at 6.3% CPU.
User avatar
turbidh20
Established Member
Posts: 190
Joined: Sun Aug 04, 2019 12:48 pm
Location: UK
Has thanked: 8 times
Been thanked: 2 times

Re: How much RT optimization is still needed?

Post by turbidh20 »

merlyn wrote: Thu Jul 30, 2020 6:05 pm
turbidh20 wrote: The only reason I've left it in is because my card is assigned to its IRQ - 18.
Where are you getting that? If I use cat /proc/interrupts it doesn't tell me what devices are on the USB bus.
Find the soundcard ->

Code: Select all

lsusb
Bus 005 Device 002: ID 1397:0508 BEHRINGER International GmbH UMC204HD 192k
Locate iSerial on the root of Bus 005 (Device 001) ->

Code: Select all

sudo lsusb -v
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  iSerial                 1 0000:0a:00.0
Find the controller with iSerial 0a:00.0 ->

Code: Select all

sudo lspci -v
0a:00.0 USB controller: ASMedia Technology Inc. ASM1042A USB 3.0 Host Controller (prog-if 30 [XHCI])
	Subsystem: ASRock Incorporation Device 1142
	Flags: bus master, fast devsel, latency 0, IRQ 18
	Memory at ef400000 (64-bit, non-prefetchable) [size=32K]
	Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
	Capabilities: [68] MSI-X: Enable+ Count=8 Masked-
	Capabilities: [78] Power Management version 3
	Capabilities: [80] Express Legacy Endpoint, MSI 00
	Capabilities: [100] Virtual Channel
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
Which gives IRQ 18 and driver xhci_hcd.

Code: Select all

rtirq status

    PID CLS RTPRIO  NI PRI %CPU STAT COMMAND	
    479 FF      90   - 130  0.0 S    irq/18-i801_smb	
    260 FF      85   - 125  0.1 S    irq/46-xhci_hcd	
    262 FF      84   - 124  3.5 S    irq/47-xhci_hcd	
    263 FF      83   - 123  0.0 S    irq/48-xhci_hcd	
    264 FF      82   - 122  0.0 S    irq/49-xhci_hcd	
    265 FF      81   - 121  0.0 S    irq/50-xhci_hcd	
    266 FF      80   - 120  0.0 S    irq/51-xhci_hcd	
    267 FF      79   - 119  0.0 S    irq/52-xhci_hcd	
    268 FF      78   - 118  0.0 S    irq/53-xhci_hcd	
    269 FF      77   - 117  0.0 S    irq/54-xhci_hcd	
As you can see, IRQ 47 is the busiest, even though I can find nothing immediately attached to it. So, as I previously alluded to, i801_smb seems superfluous even though my card is assigned IRQ 18. IRQ 46 has keyboard and mouse, so that's showing slight activity as well.
Arch Linux (i7-4790k/GTX970); UMC204HD; MPK Mini MKII; Jack2 (QjackCtl) & Ardour/Mixbus
merlyn
Established Member
Posts: 1392
Joined: Thu Oct 11, 2018 4:13 pm
Has thanked: 168 times
Been thanked: 247 times

Re: How much RT optimization is still needed?

Post by merlyn »

My USB controllers are on IRQ 18 too according to lspci. I notice your IRQ 18 is using 0% CPU -- so it could be used only for initialisation, or when connecting a device. I would think it's safe to leave it out of rtirq.conf.

I have been reading through the Ardour thread, and x42 pretty much gives instructions on what to delete on the wiki.

I also came across a tweak I'd never heard of -- it came up in a discussion of 'to swap or not to swap' and it was disabling the systemd journal. Less disk writes, also the systemd journal takes up space. It's done by editing /etc/systemd/journald.conf with this :

Code: Select all

[Journal]
Storage=none
You need to uncomment that line, and change it to 'none' from 'auto'.
User avatar
turbidh20
Established Member
Posts: 190
Joined: Sun Aug 04, 2019 12:48 pm
Location: UK
Has thanked: 8 times
Been thanked: 2 times

Re: How much RT optimization is still needed?

Post by turbidh20 »

merlyn wrote: Fri Jul 31, 2020 5:43 pmI also came across a tweak I'd never heard of -- it came up in a discussion of 'to swap or not to swap' and it was disabling the systemd journal.
I often look through the journal :wink: I don't run any DE, just a WM and a few bits like xsettingsd, so I'm running light enough not to need disabling that. Edit: I'm running on an NVME drive too, super fast.

It's a good idea of course in general to limit the background services to what you actually need. There are certain things like cupsd I only start when I want to print, for example.
Arch Linux (i7-4790k/GTX970); UMC204HD; MPK Mini MKII; Jack2 (QjackCtl) & Ardour/Mixbus
puleglot
Established Member
Posts: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: How much RT optimization is still needed?

Post by puleglot »

@turbidh20 your method of finding IRQ doesn't work for xHCI controllers. These controllers use MSI/MSI-X interrupts and allocate dedicated interrupt for each connected device (at least my old uPD720202 do).

Code: Select all

02:00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host Controller (rev 02) (prog-if 30 [XHCI])
...
    Interrupt: pin A routed to IRQ 33

Code: Select all

$ cat "/sys/devices/pci0000:00/0000:00:04.0/0000:02:00.0/irq"
33
$ rtirq status | grep irq/33-
$
$ ls "/sys/devices/pci0000:00/0000:00:04.0/0000:02:00.0/msi_irqs"
34  35  36  37  38  39  40  41
$ rtirq status | grep xhci
    180 FF      90   - 130  0.8 S    irq/34-xhci_hcd	
    182 FF      89   - 129  0.0 S    irq/35-xhci_hcd	
    183 FF      88   - 128  0.0 S    irq/36-xhci_hcd	
    184 FF      87   - 127  0.0 S    irq/37-xhci_hcd	
    185 FF      86   - 126  0.0 S    irq/38-xhci_hcd	
    186 FF      85   - 125  0.0 S    irq/39-xhci_hcd	
    187 FF      84   - 124  0.0 S    irq/40-xhci_hcd	
    188 FF      83   - 123  0.0 S    irq/41-xhci_hcd
Or alternatively via /sys/bus/pci/drivers:

Code: Select all

$ cat /sys/bus/pci/drivers/xhci_hcd/0000\:02\:00.0/irq 
33
$ ls /sys/bus/pci/drivers/xhci_hcd/0000\:02\:00.0/msi_irqs/
34  35  36  37  38  39  40  41
puleglot
Established Member
Posts: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: How much RT optimization is still needed?

Post by puleglot »

Also note that udev-rtirq (https://github.com/jhernberg/udev-rtirq) doesn't work correctly for xhci.
puleglot
Established Member
Posts: 135
Joined: Thu Jan 23, 2020 3:14 pm
Has thanked: 3 times
Been thanked: 13 times

Re: How much RT optimization is still needed?

Post by puleglot »

turbidh20 wrote: Fri Jul 31, 2020 10:39 am As you can see, IRQ 47 is the busiest, even though I can find nothing immediately attached to it.
I bet that it's a sound card. :) But I don't know how to find mapping between devices connected to xhci controller and their IRQs.
User avatar
turbidh20
Established Member
Posts: 190
Joined: Sun Aug 04, 2019 12:48 pm
Location: UK
Has thanked: 8 times
Been thanked: 2 times

Re: How much RT optimization is still needed?

Post by turbidh20 »

puleglot wrote: Tue Aug 18, 2020 11:15 pm
turbidh20 wrote: Fri Jul 31, 2020 10:39 am As you can see, IRQ 47 is the busiest, even though I can find nothing immediately attached to it.
I bet that it's a sound card. :) But I don't know how to find mapping between devices connected to xhci controller and their IRQs.
Indeed. That's the conclusion I came to :) Thanks for the other info as well, we need everything we can get!
Arch Linux (i7-4790k/GTX970); UMC204HD; MPK Mini MKII; Jack2 (QjackCtl) & Ardour/Mixbus
Drumfix
Established Member
Posts: 299
Joined: Mon Jan 26, 2009 5:15 pm
Been thanked: 11 times

Re: How much RT optimization is still needed?

Post by Drumfix »

puleglot wrote: Tue Aug 18, 2020 11:15 pm I bet that it's a sound card. :) But I don't know how to find mapping between devices connected to xhci controller and their IRQs.
Easy. All devices use the first allocated irq of an xhci host controller. Simply because the use of xhci secondary event rings and allocation of devices/enpoints to them has never been implemented.
User avatar
sysrqer
Established Member
Posts: 2519
Joined: Thu Nov 14, 2013 11:47 pm
Has thanked: 319 times
Been thanked: 148 times
Contact:

Re: How much RT optimization is still needed?

Post by sysrqer »

How about noatime, does it really make much difference these days?
Post Reply