History

cpu/topology: Export die_id

Export die_id in cpu topology, for the benefit of hardware that has multiple-die/package.

Len Brown committed 7 years ago

Commit 0e344d81 parent 14d96d63 files · +19 −3Browse files

Unified · Split

3 files
  1. Documentation/cputopology.txt +12 −3
  2. drivers/base/topology.c +4 −0
  3. include/linux/topology.h +3 −0
Documentation/cputopology.txt+12−3
@@ -12,6 +12,12 @@ physical_package_id: · 11 unmodified lines
1212 socket number, but the actual value is architecture and platform
1313 dependent.
1414
15+die_id:
16+
17+ the CPU die ID of cpuX. Typically it is the hardware platform's
18+ identifier (rather than the kernel's). The actual value is
19+ architecture and platform dependent.
20+
1521 core_id:
1622
1723 the CPU core ID of cpuX. Typically it is the hardware platform's
@@ -81,6 +87,7 @@ For an architecture to support this feature, it must define some of · 63 unmodified lines
8187 these macros in include/asm-XXX/topology.h::
8288
8389 #define topology_physical_package_id(cpu)
90+ #define topology_die_id(cpu)
8491 #define topology_core_id(cpu)
8592 #define topology_book_id(cpu)
8693 #define topology_drawer_id(cpu)
@@ -99,9 +106,11 @@ provides default definitions for any of the above macros that are · 12 unmodified lines
99106 not defined by include/asm-XXX/topology.h:
100107
101108 1) topology_physical_package_id: -1
102−2) topology_core_id: 0
103−3) topology_sibling_cpumask: just the given CPU
104−4) topology_core_cpumask: just the given CPU
109+2) topology_die_id: -1
110+3) topology_core_id: 0
111+4) topology_sibling_cpumask: just the given CPU
112+5) topology_core_cpumask: just the given CPU
113+6) topology_die_cpumask: just the given CPU
105114
106115 For architectures that don't support books (CONFIG_SCHED_BOOK) there are no
107116 default definitions for topology_book_id() and topology_book_cpumask().
drivers/base/topology.c+4−0
@@ -43,6 +43,9 @@ static ssize_t name##_list_show(struct device *dev, \ · 42 unmodified lines
4343 define_id_show_func(physical_package_id);
4444 static DEVICE_ATTR_RO(physical_package_id);
4545
46+define_id_show_func(die_id);
47+static DEVICE_ATTR_RO(die_id);
48+
4649 define_id_show_func(core_id);
4750 static DEVICE_ATTR_RO(core_id);
4851
@@ -72,6 +75,7 @@ static DEVICE_ATTR_RO(drawer_siblings_list); · 23 unmodified lines
7275
7376 static struct attribute *default_attrs[] = {
7477 &dev_attr_physical_package_id.attr,
78+ &dev_attr_die_id.attr,
7579 &dev_attr_core_id.attr,
7680 &dev_attr_thread_siblings.attr,
7781 &dev_attr_thread_siblings_list.attr,
include/linux/topology.h+3−0
@@ -184,6 +184,9 @@ static inline int cpu_to_mem(int cpu) · 183 unmodified lines
184184 #ifndef topology_physical_package_id
185185 #define topology_physical_package_id(cpu) ((void)(cpu), -1)
186186 #endif
187+#ifndef topology_die_id
188+#define topology_die_id(cpu) ((void)(cpu), -1)
189+#endif
187190 #ifndef topology_core_id
188191 #define topology_core_id(cpu) ((void)(cpu), 0)
189192 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t