IRQ-affinity.txt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ChangeLog:
  2. Started by Ingo Molnar <mingo@redhat.com>
  3. Update by Max Krasnyansky <maxk@qualcomm.com>
  4. SMP IRQ affinity
  5. /proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted
  6. for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed
  7. to turn off all CPUs, and if an IRQ controller does not support IRQ
  8. affinity then the value will not change from the default 0xffffffff.
  9. /proc/irq/default_smp_affinity specifies default affinity mask that applies
  10. to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask
  11. will be set to the default mask. It can then be changed as described above.
  12. Default mask is 0xffffffff.
  13. Here is an example of restricting IRQ44 (eth1) to CPU0-3 then restricting
  14. it to CPU4-7 (this is an 8-CPU SMP box):
  15. [root@moon 44]# cd /proc/irq/44
  16. [root@moon 44]# cat smp_affinity
  17. ffffffff
  18. [root@moon 44]# echo 0f > smp_affinity
  19. [root@moon 44]# cat smp_affinity
  20. 0000000f
  21. [root@moon 44]# ping -f h
  22. PING hell (195.4.7.3): 56 data bytes
  23. ...
  24. --- hell ping statistics ---
  25. 6029 packets transmitted, 6027 packets received, 0% packet loss
  26. round-trip min/avg/max = 0.1/0.1/0.4 ms
  27. [root@moon 44]# cat /proc/interrupts | grep 'CPU\|44:'
  28. CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
  29. 44: 1068 1785 1785 1783 0 0 0 0 IO-APIC-level eth1
  30. As can be seen from the line above IRQ44 was delivered only to the first four
  31. processors (0-3).
  32. Now lets restrict that IRQ to CPU(4-7).
  33. [root@moon 44]# echo f0 > smp_affinity
  34. [root@moon 44]# cat smp_affinity
  35. 000000f0
  36. [root@moon 44]# ping -f h
  37. PING hell (195.4.7.3): 56 data bytes
  38. ..
  39. --- hell ping statistics ---
  40. 2779 packets transmitted, 2777 packets received, 0% packet loss
  41. round-trip min/avg/max = 0.1/0.5/585.4 ms
  42. [root@moon 44]# cat /proc/interrupts | 'CPU\|44:'
  43. CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7
  44. 44: 1068 1785 1785 1783 1784 1069 1070 1069 IO-APIC-level eth1
  45. This time around IRQ44 was delivered only to the last four processors.
  46. i.e counters for the CPU0-3 did not change.