In this lesson, you will learn how to verify that your manual IRQ affinity tuning is effectively steering hardware interrupts to the intended CPU cores.
The Problem: Affinity Drift
When you manually bind an IRQ to a specific core (e.g., via /proc/irq/<irq_number>/smp_affinity), the system accepts your request, but "acceptance" doesn't always guarantee long-term performance gains. Factors like irqbalance daemons, thermal throttling events, or hot-plugged CPUs can cause the kernel to shift interrupt handling away from your chosen core. To verify your configuration, you must move beyond static file checks and analyze the actual accumulation of interrupts over time.
Verifying Distribution with /proc/interrupts
The definitive source of truth for IRQ distribution is the /proc/interrupts file. By monitoring the delta in interrupt counts across cores, you can confirm whether the workload is being pinned as intended.
Run the following command to observe the interrupt count for a specific device (e.g., your high-throughput network card) across all CPUs:
watch -d -n 1 "cat /proc/interrupts | grep eth0"
If you have pinned a specific IRQ to CPU 2, you should see the count increment exclusively in the column labeled CPU2. If you see the count climbing on CPU0 or CPU3, your affinity configuration is failing—likely due to a kernel-level override or a background service clashing with your manual settings.
Identifying Cross-Core Noise
Even if the count appears to favor your pinned core, high-performance tuning requires checking for "interrupt bouncing." If you notice counts incrementing on adjacent cores, it suggests that the assigned core is saturated and the kernel is invoking its interrupt load-balancing logic to prevent latency spikes. In such cases, your task is to correlate these findings with your previously learned Context Switch Overhead metrics to determine if the IRQ pinning is actually causing cache-line bouncing, which can negate the benefits of the pinning itself.
Key Takeaway: Monitoring IRQ affinity distribution requires observing the delta in /proc/interrupts over time to ensure your manual pinning remains consistent and isn't being silently subverted by kernel load-balancing or process migration.