Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b73ed8dc authored by Len Brown's avatar Len Brown Committed by Thomas Gleixner
Browse files

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: default avatarBrice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarIngo Molnar <mingo@kernel.org>
Acked-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/d9d3228b82fb5665e6f93a0ccd033fe022558521.1557769318.git.len.brown@intel.com
parent cfcd82e6
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -46,15 +46,15 @@ thread_siblings_list:
	human-readable list of cpuX's hardware threads within the same
	core as cpuX.

core_siblings:
package_cpus:

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

core_siblings_list:
package_cpus_list:

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

book_siblings:

+6 −0
Original line number Diff line number Diff line
@@ -57,6 +57,10 @@ define_siblings_show_func(core_siblings, core_cpumask);
static DEVICE_ATTR_RO(core_siblings);
static DEVICE_ATTR_RO(core_siblings_list);

define_siblings_show_func(package_cpus, core_cpumask);
static DEVICE_ATTR_RO(package_cpus);
static DEVICE_ATTR_RO(package_cpus_list);

#ifdef CONFIG_SCHED_BOOK
define_id_show_func(book_id);
static DEVICE_ATTR_RO(book_id);
@@ -81,6 +85,8 @@ static struct attribute *default_attrs[] = {
	&dev_attr_thread_siblings_list.attr,
	&dev_attr_core_siblings.attr,
	&dev_attr_core_siblings_list.attr,
	&dev_attr_package_cpus.attr,
	&dev_attr_package_cpus_list.attr,
#ifdef CONFIG_SCHED_BOOK
	&dev_attr_book_id.attr,
	&dev_attr_book_siblings.attr,