Purpose of irqbalance

Neil Horman nhorman at tuxdriver.com
Wed Sep 14 07:36:22 PDT 2016


On Wed, Sep 14, 2016 at 06:52:23PM +0530, Sriram V wrote:
> Hi,
> 
> Why is it that setting the smp_affinity alone is not sufficient for
> irq to be routed to other cpus?
> I tried doing that, but still the irq is only routed to cpu0.
> 
> In otherwords, why do we need a app to make the routing? how does
> irqbalance app does that?
> 
> Regards,
> Sriram
> 
Thats really two separate questions:

1) How does the irq smp_affinity setting affect irq routing

2) Why do we use irqbalance to handle affinity setting

The answer to (1) is that the smp_affinity mask provides a user defined set of
elligible cpus that can handle the corresponding irq.  For instance, setting irq
10's smp_affinity to 3 (0x11) means that cpu 0 or cpu1 is allowed to handle irq
10's interrupt.  The cpu which is actually selected is done by the hardware, and
usually amounts to the lowest numbered cpu within the elligible set that isn't
already handling an interrupt (which may explain, depending on how you set
smp_affinity) why cpu0 is still handling the interrupt your interested in.

The answer to (2) is convienience.  Manually setting smp affinity for all irqs
is a tedious process as well as an ongoing one (consider hotplug or sriov use
cases).  Irq balance can make adjustments to smp affinity to best balance irq
workload according to different policies as irqs are allocated and freed.

Hope that helps
Neil

> _______________________________________________
> irqbalance mailing list
> irqbalance at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/irqbalance
> 



More information about the irqbalance mailing list