IRQBALANCE(1)

๐Ÿ’– IRQBALANCE(1) ๐Ÿ’–

okay bestie, so this is the manual for irqbalance โ€” it lives in section 1 of the manual (that's the "user commands" section, iykyk) and it is genuinely one of the most underrated little daemons out there. let's get into it ๐Ÿซถ


โœจ NAME โœจ

irqbalance โ€” distribute hardware interrupts across processors on a multiprocessor system


๐ŸŒธ SYNOPSIS ๐ŸŒธ

irqbalance

that's it. that's the whole synopsis. she's lowkey minimalist ๐Ÿ’…


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

The whole point of irqbalance is to spread hardware interrupts across the processors on a multiprocessor system so everything gets faster. That's the entire mission statement, no cap. ๐Ÿ”ฅ


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -o, --oneshot โ€” makes irqbalance run exactly once, and then the daemon dips out. one and done, iconic behaviour โœจ
  • -d, --debug โ€” makes irqbalance print extra debug info. heads up: this implies --foreground, so you get both whether you asked or not ๐Ÿซฃ
  • -f, --foreground โ€” makes irqbalance run in the foreground (and that's without --debug).
  • -j, --journal โ€” turns on log output that's optimized for systemd-journal. journal girlies rise ๐ŸŽ€
  • -p, --powerthresh=<threshold> โ€” sets the threshold at which we try to move a CPU into powersave mode. here's the vibe: if more than <threshold> CPUs are more than 1 standard deviation below the average CPU softirq workload, and no CPUs are more than 1 standard deviation above (and have more than 1 IRQ assigned to them), then it attempts to place 1 CPU in powersave mode. and in powersave mode, a CPU gets no IRQs balanced to it at all โ€” the goal being to stop that CPU from waking up without need. let her sleep ๐Ÿ˜ด
  • -i, --banirq=<irqnum> โ€” adds the specified IRQ to the set of banned IRQs. irqbalance will not touch the affinity of any IRQs on the banned list, which lets you set them manually yourself. this option is additive and can be specified multiple times. for example, to ban IRQs 43 and 44 from balancing, use this command line:
irqbalance --banirq=43 --banirq=44
  • -m, --banmod=<module_name> โ€” adds the specified module to the set of banned modules, same energy as --banirq. irqbalance will not affect the affinity of any IRQs belonging to the given modules, so you can specify them manually. this option is additive and can be specified multiple times. for example, to ban all IRQs of module foo and module bar from balancing:
irqbalance --banmod=foo --banmod=bar
  • -c, --deepestcache=<integer> โ€” this lets you specify the cache level at which irqbalance partitions cache domains. specifying a deeper cache may give irqbalance a greater degree of flexibility to assign IRQ affinity and squeeze out bigger performance increases, but setting a cache depth too large on some systems โ€” specifically where all CPUs on a system share the deepest cache level โ€” will cause irqbalance to see balancing as unnecessary. ๐Ÿ™ˆ example:
irqbalance --deepestcache=2

The default value for deepestcache is 2.

  • -l, --policyscript=<script> โ€” when specified, the referenced script or directory will execute once for each discovered IRQ, with the sysfs device path and IRQ number passed as arguments. quick note: the device path argument will point to the parent directory from which the IRQ attributes directory may be directly opened. policy scripts need to be owned and executable by the user of the irqbalance process, and if a directory is specified, non-executable files will be skipped. the script may specify zero or more key=value pairs that guide irqbalance in the management of that IRQ. those key=value pairs get printed by the script on stdout and get captured and interpreted by irqbalance. irqbalance expects a zero exit code from the provided utility. recognized key=value pairs are:
    • ban=[true | false] โ€” directs irqbalance to exclude the passed-in IRQ from balancing.
    • balance_level=[none | package | cache | core] โ€” lets you override the balance level of a given IRQ. by default, the balance level is determined automatically based on the PCI device class of the device that owns the IRQ.
    • numa_node=<integer> โ€” lets you override the NUMA node that sysfs says a given device IRQ is local to. often, systems won't specify this info in ACPI, and as a result devices are considered equidistant from all NUMA nodes in the system. this option lets you override that hardware-provided info so irqbalance can bias IRQ affinity for those devices toward their most local node. note: specifying a -1 here forces irqbalance to consider an interrupt from a device to be equidistant from all nodes.
Also: if a directory is specified rather than a regular file, all files in the directory will be considered policy scripts, and executed on adding of an irq to a database. If such a directory is specified, scripts in the directory must additionally exit with one of the following exit codes:
  • 0 โ€” this indicates the script has a policy for the referenced irq, and that further script processing should stop.
  • 1 โ€” this indicates that the script has no policy for the referenced irq, and that script processing should continue.
  • 2 โ€” this indicates that an error has occurred in the script, and it should be skipped (further processing to continue).
  • --migrateval, -e <val> โ€” specify a minimum migration ratio to trigger a rebalancing. normally, any improvement in load distribution will trigger the migration of an irq, as long as performing the migration won't simply move the load to a new cpu. by specifying a migration value, the load balance improvement is subject to hysteresis defined by this value, which is inversely proportional to the value. for example, a value of 2 in this option tells irqbalance that the improvement in load distribution must be at least 50%; a value of 4 indicates the load distribution improvement must be at least 25%, etc. โญ
  • -s, --pid=<file> โ€” have irqbalance write its process id to the specified file. by default, no pidfile is written. the written pidfile is automatically unlinked when irqbalance exits. it is ignored when used with --debug or --foreground. ๐Ÿ’€
  • -t, --interval=<time> โ€” set the measurement time for irqbalance. it will sleep for <time> seconds between samples of the irq load on the system cpus. defaults to 10.

๐ŸŒˆ ENVIRONMENT VARIABLES ๐ŸŒˆ

  • IRQBALANCE_ONESHOT โ€” same as --oneshot.
  • IRQBALANCE_DEBUG โ€” same as --debug.
  • IRQBALANCE_BANNED_CPUS โ€” provides a mask of CPUs which irqbalance should ignore and never assign interrupts to. if not specified, irqbalance uses the mask of isolated and adaptive-ticks CPUs on the system as the default value. the "isolcpus=" boot parameter specifies the isolated CPUs, and the "nohz_full=" boot parameter specifies the adaptive-ticks CPUs. by default, no CPU will be an isolated or adaptive-ticks CPU. this is a hexmask without the leading '0x'. on systems with large numbers of processors, each group of eight hex digits is separated by a comma ','. i.e. export IRQBALANCE_BANNED_CPUS=fc0 would prevent irqbalance from assigning irqs to the 7th-12th cpus (cpu6-cpu11), or export IRQBALANCE_BANNED_CPUS=ff000000,00000001 would prevent irqbalance from assigning irqs to the 1st (cpu0) and 57th-64th cpus (cpu56-cpu63).
Notes: This environment variable will be discarded โ€” please use IRQBALANCE_BANNED_CPULIST instead. Before deleting this environment variable, introduce a deprecation period first for the consider of compatibility. ๐Ÿซถ
  • IRQBALANCE_BANNED_CPULIST โ€” provides a cpulist which irqbalance should ignore and never assign interrupts to. if not specified, irqbalance uses the mask of isolated and adaptive-ticks CPUs on the system as the default value.

๐Ÿ’œ SIGNALS ๐Ÿ’œ

  • SIGHUP โ€” forces a rescan of the available IRQs and system topology.

๐Ÿงš API ๐Ÿงš

irqbalance is able to communicate via socket and return its current assignment tree and setup, as well as set new settings based on sent values. the socket is abstract, with a name in the form of irqbalance<PID>.sock, where <PID> is the process ID of the irqbalance instance to communicate with. possible values to send:

  • stats โ€” retrieve the assignment tree of IRQs to CPUs, in a recursive manner. for each CPU node in the tree, its type, number, load and whether the save mode is active are sent. for each assigned IRQ type, its number, load, number of IRQs since last rebalancing and its class are sent. refer to the types.h file for explanation of defines.
  • setup โ€” get the current value of the sleep interval, mask of banned CPUs and list of banned IRQs.
  • settings sleep <s> โ€” set a new value of the sleep interval, <s> >= 1.
  • settings cpus <cpu_number1> <cpu_number2> ... โ€” ban the listed CPUs from IRQ handling; all old values of banned CPUs are forgotten.
  • settings ban irqs <irq1> <irq2> ... โ€” ban the listed IRQs from being balanced; all old values of banned IRQs are forgotten.

irqbalance checks the SCM_CREDENTIALS of the sender (only the root user is allowed to interact). based on the chosen tools, an ancillary message with credentials needs to be sent with the request. ๐Ÿ”


๐ŸŒŸ HOMEPAGE ๐ŸŒŸ

https://github.com/Irqbalance/irqbalance

and that's the whole page, bestie โ€” this one's a Linux manpage from December 2006, and you just read all of it, so go off ๐Ÿ’–โœจ๐ŸŽ€๐Ÿฆ‹๐ŸŒธ๐Ÿ’…๐Ÿซถ

๐Ÿ“ฆ where this page comes from