Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:services:irqbalance [2021/06/24 16:48] – created palebloodskydocs:guide-user:services:irqbalance [2024/01/02 18:48] – [Installation] mention new luci package palebloodsky
Line 1: Line 1:
 ====== Irqbalance ====== ====== Irqbalance ======
  
-Irqbalance is a Linux daemon that distributes interrupts over multiple logical CPUs. This design intent being to improve overall performance which can result in a balanced load and power consumption.+Irqbalance is a Linux daemon that distributes interrupts over multiple logical CPUs. This may result in improved overall performance and even reduced power consumption.
  
 ==== Installation ==== ==== Installation ====
  
-To get started simply install the package via [[docs:guide-user:additional-software:managing_packages#web_interface|Managing packages]]:+To get started [[docs:guide-user:additional-software:managing_packages#web_interface|install]] the package:
 <code bash>opkg update && opkg install irqbalance</code> <code bash>opkg update && opkg install irqbalance</code>
  
-The package may not be enabled by default. To enable thisedit configuration file with the editor of your choice:+Note if you run a build from main snapshot you can also install the new ''luci-app-irqbalance''
 + 
 +It will not be enabled by default. Set the following enable line to 1save and close:
 <code bash>nano /etc/config/irqbalance</code> <code bash>nano /etc/config/irqbalance</code>
-Set the enable line to 1, save and close.+ 
 +Now start the daemon: 
 +<code bash>/etc/init.d/irqbalance start</code>
  
 You're done! Performance should now be improved for multi-core targets. You're done! Performance should now be improved for multi-core targets.
Line 16: Line 20:
 ==== Advanced Usage ==== ==== Advanced Usage ====
  
-In general, these items are not necessary for irqbalance to function well, however they are provided as an exploration to test various affinity and interrupt options.+In general, the items below are not necessary for irqbalance to function, however they are used for affinityinterrupt options, and status checks.
  
-To check the status of irqbalance running simply use service:+To check the status of irqbalance simply use service:
 <code bash>service irqbalance</code> <code bash>service irqbalance</code>
  
-To set an IRQ to run on only one CPU, use echo to write the CPU mask, as a hexadecimal number, to the smp_affinity entry of the specific IRQ. In this example, we are instructing the interrupt with IRQ number 142 to run on CPU0 only:+To set an IRQ to run on a specific CPU core, use echo to write the CPU mask, as a hexadecimal number, to the smp_affinity entry of the IRQ. In this example, we are instructing the interrupt with IRQ number 142 to run on CPU0:
  
-<code bash>echo 1 > /proc/irq/142/smp_affinity</code>+<code bash>echo 1 > /proc/irq/124/smp_affinity</code>
  
 To set the core affinity use a bitmask, e.g.: To set the core affinity use a bitmask, e.g.:
Line 32: Line 36:
 To monitor the irqbalance load across cores check: To monitor the irqbalance load across cores check:
 <code bash>cat /proc/interrupts</code> <code bash>cat /proc/interrupts</code>
 +
 +==== Caution ====
 +
 +Irqbalance will result in performance benefits for multicore targets where there is enough CPU overhead to handle context switching. However on 2core targets, outside of benchmarking alone, there may be performance losses. This can happen if affinity selection is not done carefully (e.g. pinning ethernet to cpu0 and wireless to cpu1). This may result in increased latency or overhead such as with simultaneous users on LAN and WLAN. Irqbalance is more viable on 4core systems and up, however your mileage may vary. See forum discussion: https://forum.openwrt.org/t/kong-pro-firmware-for-ipq806x-r7500-r7800-ea8500/55694/395.
  
 ==== Examples ==== ==== Examples ====
  
-Examples for two common targets (borrowed from forum posts):+Example ''/proc/interrupts'' outputs for some common targets:
  
-[[toh:linksys:wrt_ac_series|WRT3200ACM]]:+[[toh:linksys:wrt_ac_series|WRT32X]]:
 <code> <code>
            CPU0       CPU1                   CPU0       CPU1       
Line 102: Line 110:
 IPI6:          0          0  completion interrupts IPI6:          0          0  completion interrupts
 Err:           0 Err:           0
 +</code>
 +
 +[[toh:raspberry_pi_foundation:raspberry_pi|Raspberry Pi 4]]:
 +<code>
 +           CPU0       CPU1       CPU2       CPU3
 +  3:    7646504    8443043    8250258     670362     GICv2  30 Level     arch_timer
 + 11:     172894          0          0          0     GICv2  65 Level     fe00b880.mailbox
 + 14:          2          0          0          0     GICv2 153 Level     uart-pl011
 + 17:       1705          0          0          0     GICv2 114 Level     DMA IRQ
 + 24:          7          0          0          0     GICv2  66 Level     VCHIQ doorbell
 + 25:      19817          0     938869          0     GICv2 158 Level     mmc1, mmc0
 + 31:   16988884          0          0          0     GICv2 189 Level     eth0
 + 32:       1497   10540404          0          0     GICv2 190 Level     eth0
 + 38:          0          0          0          0     GICv2 175 Level     PCIe PME, aerdrv
 + 39:   30845207          0          0          0  BRCM STB PCIe MSI 524288 Edge      xhci_hcd
 +IPI0:    518033     734978     575403     839272       Rescheduling interrupts
 +IPI1:     11257    7960888    8129528      11536       Function call interrupts
 +IPI2:                  0          0          0       CPU stop interrupts
 +IPI3:                  0          0          0       CPU stop (for crash dump) interrupts
 +IPI4:                  0          0          0       Timer broadcast interrupts
 +IPI5:    466242     475458     500626     321304       IRQ work interrupts
 +IPI6:                  0          0          0       CPU wake-up interrupts
 +Err:          0
 </code> </code>
  
 ==== References ==== ==== References ====
  
-Note 1: upstream man page: https://linux.die.net/man/1/irqbalance+Note 1: man page: https://linux.die.net/man/1/irqbalance
  
 Note 2: upstream github: https://github.com/Irqbalance/irqbalance/ Note 2: upstream github: https://github.com/Irqbalance/irqbalance/
 +
  • Last modified: 2024/12/02 22:08
  • by palebloodsky