I am trying to set irq affinity on linux by changing the value in smp_affinity. When I echo the new value into the file, I don't get any error but when I read it back, the value remains unchanged. I don't have irqbalance enabled, so I am not sure what else could be preventing me from changing it.

For example:

> cat /proc/irq/51/smp_affinity   
> echo 1 > /proc/irq/51/smp_affinity   
> cat /proc/irq/51/smp_affinity   

The device on IRQ 51 likely does not support IO-APIC. You can check this by running:

cat /proc/interrupts

I've provided some (edited) sample output below:

           CPU0       CPU1       CPU2       CPU3
  0:         31          0          0          0   IO-APIC-edge      timer
  6:          0          0          0          2   IO-APIC-edge      floppy
 51:          0          0          0          0   PCI-MSI-edge      PCIe PME, pciehp

On the example system I am able to change the smp_affinity for IRQ 6, but not for IRQ 51. (Although IRQ 0 lists IO-APIC-edge, I am unable to set the smp_affinity for that IRQ. I'm not sure why.)

From IO-APIC.txt:

Without an IO-APIC, interrupts from hardware will be delivered only to the CPU which boots the operating system (usually CPU#0).

Another helpful reference is SMP IRQ Affinity.

  • The interrupt for which I am trying to set the affinity for is indeed listed as PCI-MSI-edge interrupt in /proc/interrupts. But, when the same device (a 10G etherent adapter) is connected on another computer, where it is also comes up as PCI-MSI-edge interrupt, I am able to set the affinity without any problem. Jul 2 '18 at 11:16
  • You're right, and even in this example in RedHat's documentation they update the smp_affinity value for a PCI-MSI-edge interrupt: access.redhat.com/documentation/en-us/red_hat_enterprise_linux/…. Any differences between the 2 systems? Different OS versions? Does one have more than 32 CPU cores?
    – cherdt
    Jul 2 '18 at 22:28
  • Actually, the two systems are VERY different. One is a regular PC running Ubuntu 18.04 and the other is an FPGA board with ARM cortex a53 CPU running petalinux. It's possible that there is some hardware limitation that prevents the IRQ affinity from being changed, but I haven't been able to isolate the exact reason. Jul 3 '18 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.