diff options
author | Len Brown <len.brown@intel.com> | 2019-05-13 13:58:55 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-05-23 04:08:34 -0400 |
commit | b73ed8dc0597c11ec5064d06b9bbd4e541b6d4e7 (patch) | |
tree | 2945751e5a2c5b472ce3caaaad132fa92d2d5a99 | |
parent | cfcd82e632882372db960b50782a439a8ba56c09 (diff) |
topology: Create package_cpus sysfs attribute
The existing sysfs cpu/topology/core_siblings (and core_siblings_list)
attributes are documented, implemented, and used by programs to represent
set of logical CPUs sharing the same package.
This makes sense if the next topology level above a core is always a
package. But on systems where there is a die topology level between a core
and a package, the name and its definition become inconsistent.
So without changing its function, add a name for this map that describes
what it actually is -- package CPUs -- the set of CPUs that share the same
package.
This new name will be immune to changes in topology, since it describes
threads at the current level, not siblings at a contained level.
Suggested-by: Brice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/d9d3228b82fb5665e6f93a0ccd033fe022558521.1557769318.git.len.brown@intel.com
-rw-r--r-- | Documentation/cputopology.txt | 12 | ||||
-rw-r--r-- | drivers/base/topology.c | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index 2ff8a1e9a2db..48af5c290e20 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt | |||
@@ -46,15 +46,15 @@ thread_siblings_list: | |||
46 | human-readable list of cpuX's hardware threads within the same | 46 | human-readable list of cpuX's hardware threads within the same |
47 | core as cpuX. | 47 | core as cpuX. |
48 | 48 | ||
49 | core_siblings: | 49 | package_cpus: |
50 | 50 | ||
51 | internal kernel map of cpuX's hardware threads within the same | 51 | internal kernel map of the CPUs sharing the same physical_package_id. |
52 | physical_package_id. | 52 | (deprecated name: "core_siblings") |
53 | 53 | ||
54 | core_siblings_list: | 54 | package_cpus_list: |
55 | 55 | ||
56 | human-readable list of cpuX's hardware threads within the same | 56 | human-readable list of CPUs sharing the same physical_package_id. |
57 | physical_package_id. | 57 | (deprecated name: "core_siblings_list") |
58 | 58 | ||
59 | book_siblings: | 59 | book_siblings: |
60 | 60 | ||
diff --git a/drivers/base/topology.c b/drivers/base/topology.c index 50352cf96f85..dc3c19b482f3 100644 --- a/drivers/base/topology.c +++ b/drivers/base/topology.c | |||
@@ -57,6 +57,10 @@ define_siblings_show_func(core_siblings, core_cpumask); | |||
57 | static DEVICE_ATTR_RO(core_siblings); | 57 | static DEVICE_ATTR_RO(core_siblings); |
58 | static DEVICE_ATTR_RO(core_siblings_list); | 58 | static DEVICE_ATTR_RO(core_siblings_list); |
59 | 59 | ||
60 | define_siblings_show_func(package_cpus, core_cpumask); | ||
61 | static DEVICE_ATTR_RO(package_cpus); | ||
62 | static DEVICE_ATTR_RO(package_cpus_list); | ||
63 | |||
60 | #ifdef CONFIG_SCHED_BOOK | 64 | #ifdef CONFIG_SCHED_BOOK |
61 | define_id_show_func(book_id); | 65 | define_id_show_func(book_id); |
62 | static DEVICE_ATTR_RO(book_id); | 66 | static DEVICE_ATTR_RO(book_id); |
@@ -81,6 +85,8 @@ static struct attribute *default_attrs[] = { | |||
81 | &dev_attr_thread_siblings_list.attr, | 85 | &dev_attr_thread_siblings_list.attr, |
82 | &dev_attr_core_siblings.attr, | 86 | &dev_attr_core_siblings.attr, |
83 | &dev_attr_core_siblings_list.attr, | 87 | &dev_attr_core_siblings_list.attr, |
88 | &dev_attr_package_cpus.attr, | ||
89 | &dev_attr_package_cpus_list.attr, | ||
84 | #ifdef CONFIG_SCHED_BOOK | 90 | #ifdef CONFIG_SCHED_BOOK |
85 | &dev_attr_book_id.attr, | 91 | &dev_attr_book_id.attr, |
86 | &dev_attr_book_siblings.attr, | 92 | &dev_attr_book_siblings.attr, |