irqbalance in Centos and RedHat
- How to instruct any process to run with a particular core of CPU ?
- How to instruct irq to run on particular CPU Core ?
- How to check which irqbalance is in use ?
- How to manually edit the config in /etc/sysconfig/irqbalance
- How to stop the irqbalance ?
- How to start the irqbalance ?
- How to check irqbalance is running or not ?
- What is the most comman scenario ?
- How irqbalance solve this problem ?
- Why to use irqbalance ?
It is used to separate interrupts (IRQ) from the user process.
Real-time environments need to minimize or eliminate latency when responding to various events. Ideally, interrupts (IRQs) and user processes can be isolated from one another on different dedicated CPUs.
Why to use irqbalance ?
- The problem of evenly shared CPUs.
- Delay interrupt processing through having to write new data and instruction caches, and often creates conflicts with other processing occurring on the CPU.
time-critical interrupts and processes can be dedicated to a CPU (or a range of CPUs). In this way, the code and data structures needed to process this interrupt will have the highest possible likelihood to be in the processor data and instruction caches. The dedicated process can then run as quickly as possible, while all other non-time-critical processes run on the remainder of the CPUs.
What is the most common scenario?
service irqbalance status
service irqbalance start
service irqbalance stop
And also remember that irqbalance should not start on reboot automatically.
chkconfig irqbalance off
How to manually edit the config in /etc/sysconfig/irqbalance
From here we can partically disable the irqbalance
vim /etc/sysconfig/irqbalance FOLLOW_ISOLCPUS=yes
# This will make irqbalance operate only on the CPUs not specifically isolated. This has no effect on machines with only two processors but will run effectively on a dual-core machine.
How to check which irqbalance is in use?
#Each line show number of IRQ , the number of iterrupts on each core
How to instruct irq to run on particular CPU Core?
#this will instruct the cpu 0 to handle the 142 interrupts
echo 1 > /proc/irq/142/smp_affinity
Binding processes using taskset utility
my_embedded_process is instructed to run on cpu 3 and use only cpu 3
taskset 8 /usr/local/bin/my_embedded_process
The process with PID 7013 is instructed to run on cpu 0
taskset -p 1 7013