diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2010-08-31 04:28:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-09-09 14:41:25 -0400 |
commit | b40d8ed4e42c79f8ed1cf345eed0888f4a2f0678 (patch) | |
tree | e7bfe98c1cbf21a871fee2c25640898c7b60bcfb /Documentation/cputopology.txt | |
parent | 01a08546af311c065f34727787dd0cc8dc0c216f (diff) |
topology/sysfs: Provide book id and siblings attributes
Create attributes:
/sys/devices/system/cpu/cpuX/topology/book_id
/sys/devices/system/cpu/cpuX/topology/book_siblings
which show the book id and the book siblings of a cpu.
Unlike the attributes for SMT and MC these attributes are only present if
CONFIG_SCHED_BOOK is set. There is no reason to pollute sysfs for every
architecture with unused attributes.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <20100831082844.435648457@de.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'Documentation/cputopology.txt')
-rw-r--r-- | Documentation/cputopology.txt | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index f1c5c4bccd3e..902d3151f527 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt | |||
@@ -14,25 +14,39 @@ to /proc/cpuinfo. | |||
14 | identifier (rather than the kernel's). The actual value is | 14 | identifier (rather than the kernel's). The actual value is |
15 | architecture and platform dependent. | 15 | architecture and platform dependent. |
16 | 16 | ||
17 | 3) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | 17 | 3) /sys/devices/system/cpu/cpuX/topology/book_id: |
18 | |||
19 | the book ID of cpuX. Typically it is the hardware platform's | ||
20 | identifier (rather than the kernel's). The actual value is | ||
21 | architecture and platform dependent. | ||
22 | |||
23 | 4) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | ||
18 | 24 | ||
19 | internel kernel map of cpuX's hardware threads within the same | 25 | internel kernel map of cpuX's hardware threads within the same |
20 | core as cpuX | 26 | core as cpuX |
21 | 27 | ||
22 | 4) /sys/devices/system/cpu/cpuX/topology/core_siblings: | 28 | 5) /sys/devices/system/cpu/cpuX/topology/core_siblings: |
23 | 29 | ||
24 | internal kernel map of cpuX's hardware threads within the same | 30 | internal kernel map of cpuX's hardware threads within the same |
25 | physical_package_id. | 31 | physical_package_id. |
26 | 32 | ||
33 | 6) /sys/devices/system/cpu/cpuX/topology/book_siblings: | ||
34 | |||
35 | internal kernel map of cpuX's hardware threads within the same | ||
36 | book_id. | ||
37 | |||
27 | To implement it in an architecture-neutral way, a new source file, | 38 | To implement it in an architecture-neutral way, a new source file, |
28 | drivers/base/topology.c, is to export the 4 attributes. | 39 | drivers/base/topology.c, is to export the 4 or 6 attributes. The two book |
40 | related sysfs files will only be created if CONFIG_SCHED_BOOK is selected. | ||
29 | 41 | ||
30 | For an architecture to support this feature, it must define some of | 42 | For an architecture to support this feature, it must define some of |
31 | these macros in include/asm-XXX/topology.h: | 43 | these macros in include/asm-XXX/topology.h: |
32 | #define topology_physical_package_id(cpu) | 44 | #define topology_physical_package_id(cpu) |
33 | #define topology_core_id(cpu) | 45 | #define topology_core_id(cpu) |
46 | #define topology_book_id(cpu) | ||
34 | #define topology_thread_cpumask(cpu) | 47 | #define topology_thread_cpumask(cpu) |
35 | #define topology_core_cpumask(cpu) | 48 | #define topology_core_cpumask(cpu) |
49 | #define topology_book_cpumask(cpu) | ||
36 | 50 | ||
37 | The type of **_id is int. | 51 | The type of **_id is int. |
38 | The type of siblings is (const) struct cpumask *. | 52 | The type of siblings is (const) struct cpumask *. |
@@ -45,6 +59,9 @@ not defined by include/asm-XXX/topology.h: | |||
45 | 3) thread_siblings: just the given CPU | 59 | 3) thread_siblings: just the given CPU |
46 | 4) core_siblings: just the given CPU | 60 | 4) core_siblings: just the given CPU |
47 | 61 | ||
62 | For architectures that don't support books (CONFIG_SCHED_BOOK) there are no | ||
63 | default definitions for topology_book_id() and topology_book_cpumask(). | ||
64 | |||
48 | Additionally, CPU topology information is provided under | 65 | Additionally, CPU topology information is provided under |
49 | /sys/devices/system/cpu and includes these files. The internal | 66 | /sys/devices/system/cpu and includes these files. The internal |
50 | source for the output is in brackets ("[]"). | 67 | source for the output is in brackets ("[]"). |