You are not logged in.

#1 2021-02-03 21:07:11

Hubro
Member
Registered: 2019-03-09
Posts: 32

How do I disable interrupt balancing?

In an attempt to improve gaming performance in my Windows VM, I want to disable interrupt balancing on my system.

Currently, a couple of minutes after a boot, my interrupts look like this:

$ cat /proc/interrupts 
            CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       CPU8       CPU9       CPU10      CPU11      CPU12      CPU13      CPU14      CPU15      CPU16      CPU17      CPU18      CPU19      CPU20      CPU21      CPU22      CPU23      CPU24      CPU25      CPU26      CPU27      CPU28      CPU29      CPU30      CPU31      
   0:         41          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-IO-APIC    2-edge      timer
   7:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-IO-APIC    7-fasteoi   pinctrl_amd
   8:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          1          0          0          0          0          0          0  IR-IO-APIC    8-edge      rtc0
   9:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-IO-APIC    9-fasteoi   acpi
  26:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   PCI-MSI 4096-edge      AMD-Vi
  46:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0        284          0          0          0          0          0  IR-PCI-MSI 524288-edge      nvme0q0
  47:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0        284          0          0          0          0  IR-PCI-MSI 2097152-edge      nvme1q0
  50:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6815746-edge      ahci2
  51:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6815747-edge      ahci3
  64:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0        284          0          0          0  IR-PCI-MSI 2621440-edge      nvme2q0
  65:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 7340032-edge      ahci0
  66:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 7340033-edge      ahci1
  69:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 7340036-edge      ahci4
  70:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 7340037-edge      ahci5
  81:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       4320          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 524289-edge      nvme0q1
  82:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       6218          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 524290-edge      nvme0q2
  83:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0      17749          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 524291-edge      nvme0q3
  84:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       8728          0          0          0          0          0          0          0          0  IR-PCI-MSI 524292-edge      nvme0q4
  85:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       3003          0          0          0          0          0          0  IR-PCI-MSI 524293-edge      nvme0q5
  86:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       5769          0          0          0          0  IR-PCI-MSI 524294-edge      nvme0q6
  87:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       6725          0          0  IR-PCI-MSI 524295-edge      nvme0q7
  88:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       7676  IR-PCI-MSI 524296-edge      nvme0q8
  89:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       4134          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2097153-edge      nvme1q1
  90:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       6436          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2097154-edge      nvme1q2
  91:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0      17597          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2097155-edge      nvme1q3
  92:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       8648          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2097156-edge      nvme1q4
  93:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       3007          0          0          0          0          0          0          0  IR-PCI-MSI 2097157-edge      nvme1q5
  94:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       5900          0          0          0          0          0  IR-PCI-MSI 2097158-edge      nvme1q6
  95:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       6452          0          0          0  IR-PCI-MSI 2097159-edge      nvme1q7
  96:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       7398          0  IR-PCI-MSI 2097160-edge      nvme1q8
  97:          0       4239          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621441-edge      nvme2q1
  98:          0          0          0       6089          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621442-edge      nvme2q2
  99:          0          0          0          0          0      17482          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621443-edge      nvme2q3
 100:          0          0          0          0          0          0          0       8584          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621444-edge      nvme2q4
 101:          0          0          0          0          0          0          0          0          0       2967          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621445-edge      nvme2q5
 102:          0          0          0          0          0          0          0          0          0          0          0       5804          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621446-edge      nvme2q6
 103:          0          0          0          0          0          0          0          0          0          0          0          0          0       6491          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621447-edge      nvme2q7
 104:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       7730          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 2621448-edge      nvme2q8
 105:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0      66736          0          0  IR-PCI-MSI 4194304-edge      amdgpu
 106:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0      61943          0  IR-PCI-MSI 6293504-edge      xhci_hcd
 107:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0        336  IR-PCI-MSI 6297600-edge      xhci_hcd
 108:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6297601-edge      xhci_hcd
 109:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6297602-edge      xhci_hcd
 110:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6297603-edge      xhci_hcd
 111:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6297604-edge      xhci_hcd
 112:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6297605-edge      xhci_hcd
 113:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6297606-edge      xhci_hcd
 114:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 6297607-edge      xhci_hcd
 116:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919040-edge      xhci_hcd
 117:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919041-edge      xhci_hcd
 118:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919042-edge      xhci_hcd
 119:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919043-edge      xhci_hcd
 120:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919044-edge      xhci_hcd
 121:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919045-edge      xhci_hcd
 122:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919046-edge      xhci_hcd
 123:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8919047-edge      xhci_hcd
 124:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          1          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 5242880-edge      enp10s0
 125:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       6645          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 5242881-edge      enp10s0-rx-0
 126:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0         77          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 5242882-edge      enp10s0-rx-1
 127:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       4519          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 5242883-edge      enp10s0-tx-0
 128:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       4391          0          0          0          0          0          0          0          0  IR-PCI-MSI 5242884-edge      enp10s0-tx-1
 134:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          6          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718592-edge      iwlwifi: default queue
 135:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718593-edge      iwlwifi: queue 1
 136:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718594-edge      iwlwifi: queue 2
 137:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718595-edge      iwlwifi: queue 3
 138:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718596-edge      iwlwifi: queue 4
 139:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718597-edge      iwlwifi: queue 5
 140:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718598-edge      iwlwifi: queue 6
 141:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718599-edge      iwlwifi: queue 7
 142:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718600-edge      iwlwifi: queue 8
 143:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718601-edge      iwlwifi: queue 9
 144:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718602-edge      iwlwifi: queue 10
 145:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718603-edge      iwlwifi: queue 11
 146:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718604-edge      iwlwifi: queue 12
 147:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718605-edge      iwlwifi: queue 13
 148:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4718606-edge      iwlwifi: queue 14
 149:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          1  IR-PCI-MSI 4718607-edge      iwlwifi: exception
 150:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0        552          0          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 4196352-edge      snd_hda_intel:card0
 152:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0       1685          0          0          0          0          0          0          0          0          0          0          0          0          0  IR-PCI-MSI 8921088-edge      snd_hda_intel:card1
 NMI:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Non-maskable interrupts
 LOC:      25377      15277       9696       7951       9911      11389       9993       9189      10836       9029      11213       9885      20491      16900      14072      12570       7329       7465       9687       7268      11261      10041       9753       8566      12724      12778      12355      10372      11168      14689      38762      28904   Local timer interrupts
 SPU:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Spurious interrupts
 PMI:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Performance monitoring interrupts
 IWI:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   IRQ work interrupts
 RTR:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   APIC ICR read retries
 RES:       1562       1574       1580       1437       4295       4697       5234       5334       3748       5112       6587       2977       2966       2837       2208       2366       1019       1896       1495       1497       4691       3228       2622       4665       4880       4512       7590       4416       8547       2870      11076       4203   Rescheduling interrupts
 CAL:      21578      21547      22405      21159      20985      26720      21704      20005      21567      20769      23843      20241      21970      21067      16582      19183      18408      18500      19316      19382      18706      19504      35437      26514      22844      18886      24588      23664      22827      17855      23364      18537   Function call interrupts
 TLB:      13066      14151      17033      12040      19024      16736      14695      18933      16359      16003      13476      12329      16779      13356       9343      11522      11907      16137      11767      13329      11974      15946      29739      15031      17133      12390      17133      13572       9795       9419       9531      12856   TLB shootdowns
 TRM:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Thermal event interrupts
 THR:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Threshold APIC interrupts
 DFR:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Deferred Error APIC interrupts
 MCE:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Machine check exceptions
 MCP:          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1          1   Machine check polls
 ERR:          0
 MIS:          0
 PIN:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Posted-interrupt notification event
 NPI:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Nested posted-interrupt event
 PIW:          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0   Posted-interrupt wakeup event

They are spread evenly across my cores.

After a bit of Googling, it seems that disabling/uninstalling the irqbalance daemon (I already don't have it) and adding "noirqbalance" to my boot arguments should disable this behavior.

I have done this and rebooted, but interrupts are still being distributed evenly across cores.

How do I stop this behavior? Ideally I want all interrupts to go to core 0, or even core 0-3 if that helps performance. I just want to keep interrupts away from the cores where I run my VM.

Here are my current boot arguments:

GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet amd_iommu=on iommu=pt vfio-pci.ids=10de:2204,10de:1aef force_tsc_stable=1 nmi_watchdog=0 watchdog=0 force_tsc_stable=1 pcie_aspm=off tsc=reliable mitigations=off mds=off nopti spec_store_bypass_disable=off processor.max_cstate=1 noirqbalance"

I'm using a Ryzen 3950X and a X570 chipset.

$ uname -a
Linux aura 5.10.9-arch1-1 #1 SMP PREEMPT Tue, 19 Jan 2021 22:06:06 +0000 x86_64 GNU/Linux

Offline

#2 2021-02-03 22:49:35

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: How do I disable interrupt balancing?

I just tried the following and it seems to basically work:

irqaffinity=0-3

Most device interrupts now are on the first four CPUs except for my NVME drive. The NVME drive still produces interrupts on all cores/threads.

That "irqbalance" thing you found is old. I remember at some point in the last few years its job was taken over by the kernel itself and now irqbalance isn't needed anymore. I found the "irqaffinity=..." kernel command line parameter by searching for "irq" in the "kernel-parameters.txt" file that's installed by "linux-docs".

Last edited by Ropid (2021-02-03 22:50:10)

Offline

Board footer

Powered by FluxBB