Skip to content

Commit b73ed8d

Browse files
lenbKAGA-KOKO
authored andcommitted
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 <[email protected]> Signed-off-by: Len Brown <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ingo Molnar <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/d9d3228b82fb5665e6f93a0ccd033fe022558521.1557769318.git.len.brown@intel.com
1 parent cfcd82e commit b73ed8d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

Documentation/cputopology.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ thread_siblings_list:
4646
human-readable list of cpuX's hardware threads within the same
4747
core as cpuX.
4848

49-
core_siblings:
49+
package_cpus:
5050

51-
internal kernel map of cpuX's hardware threads within the same
52-
physical_package_id.
51+
internal kernel map of the CPUs sharing the same physical_package_id.
52+
(deprecated name: "core_siblings")
5353

54-
core_siblings_list:
54+
package_cpus_list:
5555

56-
human-readable list of cpuX's hardware threads within the same
57-
physical_package_id.
56+
human-readable list of CPUs sharing the same physical_package_id.
57+
(deprecated name: "core_siblings_list")
5858

5959
book_siblings:
6060

drivers/base/topology.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ define_siblings_show_func(core_siblings, core_cpumask);
5757
static DEVICE_ATTR_RO(core_siblings);
5858
static DEVICE_ATTR_RO(core_siblings_list);
5959

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+
6064
#ifdef CONFIG_SCHED_BOOK
6165
define_id_show_func(book_id);
6266
static DEVICE_ATTR_RO(book_id);
@@ -81,6 +85,8 @@ static struct attribute *default_attrs[] = {
8185
&dev_attr_thread_siblings_list.attr,
8286
&dev_attr_core_siblings.attr,
8387
&dev_attr_core_siblings_list.attr,
88+
&dev_attr_package_cpus.attr,
89+
&dev_attr_package_cpus_list.attr,
8490
#ifdef CONFIG_SCHED_BOOK
8591
&dev_attr_book_id.attr,
8692
&dev_attr_book_siblings.attr,

0 commit comments

Comments
 (0)