diff options
Diffstat (limited to 'Documentation/cputopology.txt')
-rw-r--r-- | Documentation/cputopology.txt | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index 0aad6deb2d96..12b1b25b4da9 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | ||
2 | Export CPU topology info via sysfs. Items (attributes) are similar | 2 | Export CPU topology info via sysfs. Items (attributes) are similar |
3 | to /proc/cpuinfo. | 3 | to /proc/cpuinfo output of some architectures: |
4 | 4 | ||
5 | 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: | 5 | 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: |
6 | 6 | ||
@@ -23,20 +23,35 @@ to /proc/cpuinfo. | |||
23 | 4) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | 23 | 4) /sys/devices/system/cpu/cpuX/topology/thread_siblings: |
24 | 24 | ||
25 | internal kernel map of cpuX's hardware threads within the same | 25 | internal kernel map of cpuX's hardware threads within the same |
26 | core as cpuX | 26 | core as cpuX. |
27 | 27 | ||
28 | 5) /sys/devices/system/cpu/cpuX/topology/core_siblings: | 28 | 5) /sys/devices/system/cpu/cpuX/topology/thread_siblings_list: |
29 | |||
30 | human-readable list of cpuX's hardware threads within the same | ||
31 | core as cpuX. | ||
32 | |||
33 | 6) /sys/devices/system/cpu/cpuX/topology/core_siblings: | ||
29 | 34 | ||
30 | internal kernel map of cpuX's hardware threads within the same | 35 | internal kernel map of cpuX's hardware threads within the same |
31 | physical_package_id. | 36 | physical_package_id. |
32 | 37 | ||
33 | 6) /sys/devices/system/cpu/cpuX/topology/book_siblings: | 38 | 7) /sys/devices/system/cpu/cpuX/topology/core_siblings_list: |
39 | |||
40 | human-readable list of cpuX's hardware threads within the same | ||
41 | physical_package_id. | ||
42 | |||
43 | 8) /sys/devices/system/cpu/cpuX/topology/book_siblings: | ||
34 | 44 | ||
35 | internal kernel map of cpuX's hardware threads within the same | 45 | internal kernel map of cpuX's hardware threads within the same |
36 | book_id. | 46 | book_id. |
37 | 47 | ||
48 | 9) /sys/devices/system/cpu/cpuX/topology/book_siblings_list: | ||
49 | |||
50 | human-readable list of cpuX's hardware threads within the same | ||
51 | book_id. | ||
52 | |||
38 | To implement it in an architecture-neutral way, a new source file, | 53 | To implement it in an architecture-neutral way, a new source file, |
39 | drivers/base/topology.c, is to export the 4 or 6 attributes. The two book | 54 | drivers/base/topology.c, is to export the 6 or 9 attributes. The three book |
40 | related sysfs files will only be created if CONFIG_SCHED_BOOK is selected. | 55 | related sysfs files will only be created if CONFIG_SCHED_BOOK is selected. |
41 | 56 | ||
42 | For an architecture to support this feature, it must define some of | 57 | For an architecture to support this feature, it must define some of |
@@ -44,20 +59,22 @@ these macros in include/asm-XXX/topology.h: | |||
44 | #define topology_physical_package_id(cpu) | 59 | #define topology_physical_package_id(cpu) |
45 | #define topology_core_id(cpu) | 60 | #define topology_core_id(cpu) |
46 | #define topology_book_id(cpu) | 61 | #define topology_book_id(cpu) |
47 | #define topology_thread_cpumask(cpu) | 62 | #define topology_sibling_cpumask(cpu) |
48 | #define topology_core_cpumask(cpu) | 63 | #define topology_core_cpumask(cpu) |
49 | #define topology_book_cpumask(cpu) | 64 | #define topology_book_cpumask(cpu) |
50 | 65 | ||
51 | The type of **_id is int. | 66 | The type of **_id macros is int. |
52 | The type of siblings is (const) struct cpumask *. | 67 | The type of **_cpumask macros is (const) struct cpumask *. The latter |
68 | correspond with appropriate **_siblings sysfs attributes (except for | ||
69 | topology_sibling_cpumask() which corresponds with thread_siblings). | ||
53 | 70 | ||
54 | To be consistent on all architectures, include/linux/topology.h | 71 | To be consistent on all architectures, include/linux/topology.h |
55 | provides default definitions for any of the above macros that are | 72 | provides default definitions for any of the above macros that are |
56 | not defined by include/asm-XXX/topology.h: | 73 | not defined by include/asm-XXX/topology.h: |
57 | 1) physical_package_id: -1 | 74 | 1) physical_package_id: -1 |
58 | 2) core_id: 0 | 75 | 2) core_id: 0 |
59 | 3) thread_siblings: just the given CPU | 76 | 3) sibling_cpumask: just the given CPU |
60 | 4) core_siblings: just the given CPU | 77 | 4) core_cpumask: just the given CPU |
61 | 78 | ||
62 | For architectures that don't support books (CONFIG_SCHED_BOOK) there are no | 79 | For architectures that don't support books (CONFIG_SCHED_BOOK) there are no |
63 | default definitions for topology_book_id() and topology_book_cpumask(). | 80 | default definitions for topology_book_id() and topology_book_cpumask(). |