diff options
author | Mike Travis <travis@sgi.com> | 2011-05-24 20:13:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-25 11:39:45 -0400 |
commit | 4b060420a596095869a6d7849caa798d23839cd1 (patch) | |
tree | ebbbc25555d0358f73527f114f78691ac849ce3e /Documentation | |
parent | e50c1f609c63223adaa38f5a79b18759a00adf72 (diff) |
bitmap, irq: add smp_affinity_list interface to /proc/irq
Manually adjusting the smp_affinity for IRQ's becomes unwieldy when the
cpu count is large.
Setting smp affinity to cpus 256 to 263 would be:
echo 000000ff,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > smp_affinity
instead of:
echo 256-263 > smp_affinity_list
Think about what it looks like for cpus around say, 4088 to 4095.
We already have many alternate "list" interfaces:
/sys/devices/system/cpu/cpuX/indexY/shared_cpu_list
/sys/devices/system/cpu/cpuX/topology/thread_siblings_list
/sys/devices/system/cpu/cpuX/topology/core_siblings_list
/sys/devices/system/node/nodeX/cpulist
/sys/devices/pci***/***/local_cpulist
Add a companion interface, smp_affinity_list to use cpu lists instead of
cpu maps. This conforms to other companion interfaces where both a map
and a list interface exists.
This required adding a bitmap_parselist_user() function in a manner
similar to the bitmap_parse_user() function.
[akpm@linux-foundation.org: make __bitmap_parselist() static]
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jack Steiner <steiner@sgi.com>
Cc: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/IRQ-affinity.txt | 17 | ||||
-rw-r--r-- | Documentation/filesystems/proc.txt | 11 |
2 files changed, 22 insertions, 6 deletions
diff --git a/Documentation/IRQ-affinity.txt b/Documentation/IRQ-affinity.txt index b4a615b78403..7890fae18529 100644 --- a/Documentation/IRQ-affinity.txt +++ b/Documentation/IRQ-affinity.txt | |||
@@ -4,10 +4,11 @@ ChangeLog: | |||
4 | 4 | ||
5 | SMP IRQ affinity | 5 | SMP IRQ affinity |
6 | 6 | ||
7 | /proc/irq/IRQ#/smp_affinity specifies which target CPUs are permitted | 7 | /proc/irq/IRQ#/smp_affinity and /proc/irq/IRQ#/smp_affinity_list specify |
8 | for a given IRQ source. It's a bitmask of allowed CPUs. It's not allowed | 8 | which target CPUs are permitted for a given IRQ source. It's a bitmask |
9 | to turn off all CPUs, and if an IRQ controller does not support IRQ | 9 | (smp_affinity) or cpu list (smp_affinity_list) of allowed CPUs. It's not |
10 | affinity then the value will not change from the default 0xffffffff. | 10 | allowed to turn off all CPUs, and if an IRQ controller does not support |
11 | IRQ affinity then the value will not change from the default of all cpus. | ||
11 | 12 | ||
12 | /proc/irq/default_smp_affinity specifies default affinity mask that applies | 13 | /proc/irq/default_smp_affinity specifies default affinity mask that applies |
13 | to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask | 14 | to all non-active IRQs. Once IRQ is allocated/activated its affinity bitmask |
@@ -54,3 +55,11 @@ round-trip min/avg/max = 0.1/0.5/585.4 ms | |||
54 | This time around IRQ44 was delivered only to the last four processors. | 55 | This time around IRQ44 was delivered only to the last four processors. |
55 | i.e counters for the CPU0-3 did not change. | 56 | i.e counters for the CPU0-3 did not change. |
56 | 57 | ||
58 | Here is an example of limiting that same irq (44) to cpus 1024 to 1031: | ||
59 | |||
60 | [root@moon 44]# echo 1024-1031 > smp_affinity | ||
61 | [root@moon 44]# cat smp_affinity | ||
62 | 1024-1031 | ||
63 | |||
64 | Note that to do this with a bitmask would require 32 bitmasks of zero | ||
65 | to follow the pertinent one. | ||
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt index 60740e8ecb37..f48178024067 100644 --- a/Documentation/filesystems/proc.txt +++ b/Documentation/filesystems/proc.txt | |||
@@ -574,6 +574,12 @@ The contents of each smp_affinity file is the same by default: | |||
574 | > cat /proc/irq/0/smp_affinity | 574 | > cat /proc/irq/0/smp_affinity |
575 | ffffffff | 575 | ffffffff |
576 | 576 | ||
577 | There is an alternate interface, smp_affinity_list which allows specifying | ||
578 | a cpu range instead of a bitmask: | ||
579 | |||
580 | > cat /proc/irq/0/smp_affinity_list | ||
581 | 1024-1031 | ||
582 | |||
577 | The default_smp_affinity mask applies to all non-active IRQs, which are the | 583 | The default_smp_affinity mask applies to all non-active IRQs, which are the |
578 | IRQs which have not yet been allocated/activated, and hence which lack a | 584 | IRQs which have not yet been allocated/activated, and hence which lack a |
579 | /proc/irq/[0-9]* directory. | 585 | /proc/irq/[0-9]* directory. |
@@ -583,12 +589,13 @@ reports itself as being attached. This hardware locality information does not | |||
583 | include information about any possible driver locality preference. | 589 | include information about any possible driver locality preference. |
584 | 590 | ||
585 | prof_cpu_mask specifies which CPUs are to be profiled by the system wide | 591 | prof_cpu_mask specifies which CPUs are to be profiled by the system wide |
586 | profiler. Default value is ffffffff (all cpus). | 592 | profiler. Default value is ffffffff (all cpus if there are only 32 of them). |
587 | 593 | ||
588 | The way IRQs are routed is handled by the IO-APIC, and it's Round Robin | 594 | The way IRQs are routed is handled by the IO-APIC, and it's Round Robin |
589 | between all the CPUs which are allowed to handle it. As usual the kernel has | 595 | between all the CPUs which are allowed to handle it. As usual the kernel has |
590 | more info than you and does a better job than you, so the defaults are the | 596 | more info than you and does a better job than you, so the defaults are the |
591 | best choice for almost everyone. | 597 | best choice for almost everyone. [Note this applies only to those IO-APIC's |
598 | that support "Round Robin" interrupt distribution.] | ||
592 | 599 | ||
593 | There are three more important subdirectories in /proc: net, scsi, and sys. | 600 | There are three more important subdirectories in /proc: net, scsi, and sys. |
594 | The general rule is that the contents, or even the existence of these | 601 | The general rule is that the contents, or even the existence of these |