summaryrefslogtreecommitdiffstats
path: root/Documentation/cputopology.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/cputopology.txt')
-rw-r--r--Documentation/cputopology.txt37
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
2Export CPU topology info via sysfs. Items (attributes) are similar 2Export CPU topology info via sysfs. Items (attributes) are similar
3to /proc/cpuinfo. 3to /proc/cpuinfo output of some architectures:
4 4
51) /sys/devices/system/cpu/cpuX/topology/physical_package_id: 51) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
6 6
@@ -23,20 +23,35 @@ to /proc/cpuinfo.
234) /sys/devices/system/cpu/cpuX/topology/thread_siblings: 234) /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
285) /sys/devices/system/cpu/cpuX/topology/core_siblings: 285) /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
336) /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
336) /sys/devices/system/cpu/cpuX/topology/book_siblings: 387) /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
438) /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
489) /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
38To implement it in an architecture-neutral way, a new source file, 53To implement it in an architecture-neutral way, a new source file,
39drivers/base/topology.c, is to export the 4 or 6 attributes. The two book 54drivers/base/topology.c, is to export the 6 or 9 attributes. The three book
40related sysfs files will only be created if CONFIG_SCHED_BOOK is selected. 55related sysfs files will only be created if CONFIG_SCHED_BOOK is selected.
41 56
42For an architecture to support this feature, it must define some of 57For 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
51The type of **_id is int. 66The type of **_id macros is int.
52The type of siblings is (const) struct cpumask *. 67The type of **_cpumask macros is (const) struct cpumask *. The latter
68correspond with appropriate **_siblings sysfs attributes (except for
69topology_sibling_cpumask() which corresponds with thread_siblings).
53 70
54To be consistent on all architectures, include/linux/topology.h 71To be consistent on all architectures, include/linux/topology.h
55provides default definitions for any of the above macros that are 72provides default definitions for any of the above macros that are
56not defined by include/asm-XXX/topology.h: 73not defined by include/asm-XXX/topology.h:
571) physical_package_id: -1 741) physical_package_id: -1
582) core_id: 0 752) core_id: 0
593) thread_siblings: just the given CPU 763) sibling_cpumask: just the given CPU
604) core_siblings: just the given CPU 774) core_cpumask: just the given CPU
61 78
62For architectures that don't support books (CONFIG_SCHED_BOOK) there are no 79For architectures that don't support books (CONFIG_SCHED_BOOK) there are no
63default definitions for topology_book_id() and topology_book_cpumask(). 80default definitions for topology_book_id() and topology_book_cpumask().