Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cputopology.txt: standardize document format

Each text file under Documentation follows a different
format. Some doesn't even have titles!

Change its representation to follow the adopted standard,
using ReST markups for it to be parseable by Sphinx:

- Add a title for the document;
- mark literals;
- use table markup for existing table.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
e8cb6f1e 09338fb0

+21 -14
+21 -14
Documentation/cputopology.txt
··· 1 + =========================================== 2 + How CPU topology info is exported via sysfs 3 + =========================================== 1 4 2 5 Export CPU topology info via sysfs. Items (attributes) are similar 3 6 to /proc/cpuinfo output of some architectures: ··· 78 75 they reflect the cpu and cache hierarchy. 79 76 80 77 For an architecture to support this feature, it must define some of 81 - these macros in include/asm-XXX/topology.h: 82 - #define topology_physical_package_id(cpu) 83 - #define topology_core_id(cpu) 84 - #define topology_book_id(cpu) 85 - #define topology_drawer_id(cpu) 86 - #define topology_sibling_cpumask(cpu) 87 - #define topology_core_cpumask(cpu) 88 - #define topology_book_cpumask(cpu) 89 - #define topology_drawer_cpumask(cpu) 78 + these macros in include/asm-XXX/topology.h:: 90 79 91 - The type of **_id macros is int. 92 - The type of **_cpumask macros is (const) struct cpumask *. The latter 93 - correspond with appropriate **_siblings sysfs attributes (except for 80 + #define topology_physical_package_id(cpu) 81 + #define topology_core_id(cpu) 82 + #define topology_book_id(cpu) 83 + #define topology_drawer_id(cpu) 84 + #define topology_sibling_cpumask(cpu) 85 + #define topology_core_cpumask(cpu) 86 + #define topology_book_cpumask(cpu) 87 + #define topology_drawer_cpumask(cpu) 88 + 89 + The type of ``**_id macros`` is int. 90 + The type of ``**_cpumask macros`` is ``(const) struct cpumask *``. The latter 91 + correspond with appropriate ``**_siblings`` sysfs attributes (except for 94 92 topology_sibling_cpumask() which corresponds with thread_siblings). 95 93 96 94 To be consistent on all architectures, include/linux/topology.h 97 95 provides default definitions for any of the above macros that are 98 96 not defined by include/asm-XXX/topology.h: 97 + 99 98 1) physical_package_id: -1 100 99 2) core_id: 0 101 100 3) sibling_cpumask: just the given CPU ··· 112 107 /sys/devices/system/cpu and includes these files. The internal 113 108 source for the output is in brackets ("[]"). 114 109 110 + =========== ========================================================== 115 111 kernel_max: the maximum CPU index allowed by the kernel configuration. 116 112 [NR_CPUS-1] 117 113 ··· 128 122 129 123 present: CPUs that have been identified as being present in the 130 124 system. [cpu_present_mask] 125 + =========== ========================================================== 131 126 132 127 The format for the above output is compatible with cpulist_parse() 133 128 [see <linux/cpumask.h>]. Some examples follow. ··· 136 129 In this example, there are 64 CPUs in the system but cpus 32-63 exceed 137 130 the kernel max which is limited to 0..31 by the NR_CPUS config option 138 131 being 32. Note also that CPUs 2 and 4-31 are not online but could be 139 - brought online as they are both present and possible. 132 + brought online as they are both present and possible:: 140 133 141 134 kernel_max: 31 142 135 offline: 2,4-31,32-63 ··· 147 140 In this example, the NR_CPUS config option is 128, but the kernel was 148 141 started with possible_cpus=144. There are 4 CPUs in the system and cpu2 149 142 was manually taken offline (and is the only CPU that can be brought 150 - online.) 143 + online.):: 151 144 152 145 kernel_max: 127 153 146 offline: 2,4-127,128-143