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
12 socket number, but the actual value is architecture and platform12 socket number, but the actual value is architecture and platform
13 dependent.13 dependent.
14 14
15die_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
15core_id:21core_id:
16 22
17 the CPU core ID of cpuX. Typically it is the hardware platform's23 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
81these macros in include/asm-XXX/topology.h::87these macros in include/asm-XXX/topology.h::
82 88
83 #define topology_physical_package_id(cpu)89 #define topology_physical_package_id(cpu)
90 #define topology_die_id(cpu)
84 #define topology_core_id(cpu)91 #define topology_core_id(cpu)
85 #define topology_book_id(cpu)92 #define topology_book_id(cpu)
86 #define topology_drawer_id(cpu)93 #define topology_drawer_id(cpu)
@@ -99,9 +106,11 @@ provides default definitions for any of the above macros that are · 12 unmodified lines
99not defined by include/asm-XXX/topology.h:106not defined by include/asm-XXX/topology.h:
100 107
1011) topology_physical_package_id: -11081) topology_physical_package_id: -1
1022) topology_core_id: 01092) topology_die_id: -1
1033) topology_sibling_cpumask: just the given CPU1103) topology_core_id: 0
1044) topology_core_cpumask: just the given CPU1114) topology_sibling_cpumask: just the given CPU
1125) topology_core_cpumask: just the given CPU
1136) topology_die_cpumask: just the given CPU
105 114
106For architectures that don't support books (CONFIG_SCHED_BOOK) there are no115For architectures that don't support books (CONFIG_SCHED_BOOK) there are no
107default definitions for topology_book_id() and topology_book_cpumask().116default 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
43define_id_show_func(physical_package_id);43define_id_show_func(physical_package_id);
44static DEVICE_ATTR_RO(physical_package_id);44static DEVICE_ATTR_RO(physical_package_id);
45 45
46define_id_show_func(die_id);
47static DEVICE_ATTR_RO(die_id);
48
46define_id_show_func(core_id);49define_id_show_func(core_id);
47static DEVICE_ATTR_RO(core_id);50static DEVICE_ATTR_RO(core_id);
48 51
@@ -72,6 +75,7 @@ static DEVICE_ATTR_RO(drawer_siblings_list); · 23 unmodified lines
72 75
73static struct attribute *default_attrs[] = {76static struct attribute *default_attrs[] = {
74 &dev_attr_physical_package_id.attr,77 &dev_attr_physical_package_id.attr,
78 &dev_attr_die_id.attr,
75 &dev_attr_core_id.attr,79 &dev_attr_core_id.attr,
76 &dev_attr_thread_siblings.attr,80 &dev_attr_thread_siblings.attr,
77 &dev_attr_thread_siblings_list.attr,81 &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
184#ifndef topology_physical_package_id184#ifndef topology_physical_package_id
185#define topology_physical_package_id(cpu) ((void)(cpu), -1)185#define topology_physical_package_id(cpu) ((void)(cpu), -1)
186#endif186#endif
187#ifndef topology_die_id
188#define topology_die_id(cpu) ((void)(cpu), -1)
189#endif
187#ifndef topology_core_id190#ifndef topology_core_id
188#define topology_core_id(cpu) ((void)(cpu), 0)191#define topology_core_id(cpu) ((void)(cpu), 0)
189#endif192#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