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

Documentation: Update cputopology.txt

The documentation on cpu topology seems to be a bit out-of-date.
It doesn't mention the **_siblings_list attributes and uses old
names for topology_**_cpumask() macros.

Add information on missing attributes plus some additional
clarifications.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Benoit Cousson <bcousson@baylibre.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Link: http://lkml.kernel.org/r/1432645896-12588-3-git-send-email-bgolaszewski@baylibre.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Bartosz Golaszewski and committed by
Ingo Molnar
54a53694 06931e62

+26 -9
+26 -9
Documentation/cputopology.txt
··· 1 1 2 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 5 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: 6 6 ··· 23 23 4) /sys/devices/system/cpu/cpuX/topology/thread_siblings: 24 24 25 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 35 internal kernel map of cpuX's hardware threads within the same 31 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 45 internal kernel map of cpuX's hardware threads within the same 36 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 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 55 related sysfs files will only be created if CONFIG_SCHED_BOOK is selected. 41 56 42 57 For an architecture to support this feature, it must define some of ··· 63 48 #define topology_core_cpumask(cpu) 64 49 #define topology_book_cpumask(cpu) 65 50 66 - The type of **_id is int. 67 - The type of siblings is (const) struct cpumask *. 51 + The type of **_id macros is int. 52 + The type of **_cpumask macros is (const) struct cpumask *. The latter 53 + correspond with appropriate **_siblings sysfs attributes (except for 54 + topology_sibling_cpumask() which corresponds with thread_siblings). 68 55 69 56 To be consistent on all architectures, include/linux/topology.h 70 57 provides default definitions for any of the above macros that are 71 58 not defined by include/asm-XXX/topology.h: 72 59 1) physical_package_id: -1 73 60 2) core_id: 0 74 - 3) thread_siblings: just the given CPU 75 - 4) core_siblings: just the given CPU 61 + 3) sibling_cpumask: just the given CPU 62 + 4) core_cpumask: just the given CPU 76 63 77 64 For architectures that don't support books (CONFIG_SCHED_BOOK) there are no 78 65 default definitions for topology_book_id() and topology_book_cpumask().