Commit 948a6499 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-topology-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 topology updates from Ingo Molnar:
 "Two main changes: preparatory changes for Intel multi-die topology
  support, plus a syslog message tweak"

* 'x86-topology-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/topology: Make DEBUG_HOTPLUG_CPU0 pr_info() more descriptive
  x86/smpboot: Rename match_die() to match_pkg()
  topology: Simplify cputopology.txt formatting and wording
  x86/topology: Fix documentation typo
parents db10ad04 8fea0f59
...@@ -3,79 +3,79 @@ How CPU topology info is exported via sysfs ...@@ -3,79 +3,79 @@ How CPU topology info is exported via sysfs
=========================================== ===========================================
Export CPU topology info via sysfs. Items (attributes) are similar Export CPU topology info via sysfs. Items (attributes) are similar
to /proc/cpuinfo output of some architectures: to /proc/cpuinfo output of some architectures. They reside in
/sys/devices/system/cpu/cpuX/topology/:
1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: physical_package_id:
physical package id of cpuX. Typically corresponds to a physical physical package id of cpuX. Typically corresponds to a physical
socket number, but the actual value is architecture and platform socket number, but the actual value is architecture and platform
dependent. dependent.
2) /sys/devices/system/cpu/cpuX/topology/core_id: core_id:
the CPU core ID of cpuX. Typically it is the hardware platform's the CPU core ID of cpuX. Typically it is the hardware platform's
identifier (rather than the kernel's). The actual value is identifier (rather than the kernel's). The actual value is
architecture and platform dependent. architecture and platform dependent.
3) /sys/devices/system/cpu/cpuX/topology/book_id: book_id:
the book ID of cpuX. Typically it is the hardware platform's the book ID of cpuX. Typically it is the hardware platform's
identifier (rather than the kernel's). The actual value is identifier (rather than the kernel's). The actual value is
architecture and platform dependent. architecture and platform dependent.
4) /sys/devices/system/cpu/cpuX/topology/drawer_id: drawer_id:
the drawer ID of cpuX. Typically it is the hardware platform's the drawer ID of cpuX. Typically it is the hardware platform's
identifier (rather than the kernel's). The actual value is identifier (rather than the kernel's). The actual value is
architecture and platform dependent. architecture and platform dependent.
5) /sys/devices/system/cpu/cpuX/topology/thread_siblings: thread_siblings:
internal kernel map of cpuX's hardware threads within the same internal kernel map of cpuX's hardware threads within the same
core as cpuX. core as cpuX.
6) /sys/devices/system/cpu/cpuX/topology/thread_siblings_list: thread_siblings_list:
human-readable list of cpuX's hardware threads within the same human-readable list of cpuX's hardware threads within the same
core as cpuX. core as cpuX.
7) /sys/devices/system/cpu/cpuX/topology/core_siblings: core_siblings:
internal kernel map of cpuX's hardware threads within the same internal kernel map of cpuX's hardware threads within the same
physical_package_id. physical_package_id.
8) /sys/devices/system/cpu/cpuX/topology/core_siblings_list: core_siblings_list:
human-readable list of cpuX's hardware threads within the same human-readable list of cpuX's hardware threads within the same
physical_package_id. physical_package_id.
9) /sys/devices/system/cpu/cpuX/topology/book_siblings: book_siblings:
internal kernel map of cpuX's hardware threads within the same internal kernel map of cpuX's hardware threads within the same
book_id. book_id.
10) /sys/devices/system/cpu/cpuX/topology/book_siblings_list: book_siblings_list:
human-readable list of cpuX's hardware threads within the same human-readable list of cpuX's hardware threads within the same
book_id. book_id.
11) /sys/devices/system/cpu/cpuX/topology/drawer_siblings: drawer_siblings:
internal kernel map of cpuX's hardware threads within the same internal kernel map of cpuX's hardware threads within the same
drawer_id. drawer_id.
12) /sys/devices/system/cpu/cpuX/topology/drawer_siblings_list: drawer_siblings_list:
human-readable list of cpuX's hardware threads within the same human-readable list of cpuX's hardware threads within the same
drawer_id. drawer_id.
To implement it in an architecture-neutral way, a new source file, Architecture-neutral, drivers/base/topology.c, exports these attributes.
drivers/base/topology.c, is to export the 6 to 12 attributes. The book However, the book and drawer related sysfs files will only be created if
and drawer related sysfs files will only be created if CONFIG_SCHED_BOOK CONFIG_SCHED_BOOK and CONFIG_SCHED_DRAWER are selected, respectively.
and CONFIG_SCHED_DRAWER are selected.
CONFIG_SCHED_BOOK and CONFIG_DRAWER are currently only used on s390, where CONFIG_SCHED_BOOK and CONFIG_SCHED_DRAWER are currently only used on s390,
they reflect the cpu and cache hierarchy. where they reflect the cpu and cache hierarchy.
For an architecture to support this feature, it must define some of For an architecture to support this feature, it must define some of
these macros in include/asm-XXX/topology.h:: these macros in include/asm-XXX/topology.h::
...@@ -98,10 +98,10 @@ To be consistent on all architectures, include/linux/topology.h ...@@ -98,10 +98,10 @@ To be consistent on all architectures, include/linux/topology.h
provides default definitions for any of the above macros that are provides default definitions for any of the above macros that are
not defined by include/asm-XXX/topology.h: not defined by include/asm-XXX/topology.h:
1) physical_package_id: -1 1) topology_physical_package_id: -1
2) core_id: 0 2) topology_core_id: 0
3) sibling_cpumask: just the given CPU 3) topology_sibling_cpumask: just the given CPU
4) core_cpumask: just the given CPU 4) topology_core_cpumask: just the given CPU
For architectures that don't support books (CONFIG_SCHED_BOOK) there are no For architectures that don't support books (CONFIG_SCHED_BOOK) there are no
default definitions for topology_book_id() and topology_book_cpumask(). default definitions for topology_book_id() and topology_book_cpumask().
......
...@@ -51,7 +51,7 @@ The topology of a system is described in the units of: ...@@ -51,7 +51,7 @@ The topology of a system is described in the units of:
The physical ID of the package. This information is retrieved via CPUID The physical ID of the package. This information is retrieved via CPUID
and deduced from the APIC IDs of the cores in the package. and deduced from the APIC IDs of the cores in the package.
- cpuinfo_x86.logical_id: - cpuinfo_x86.logical_proc_id:
The logical ID of the package. As we do not trust BIOSes to enumerate the The logical ID of the package. As we do not trust BIOSes to enumerate the
packages in a consistent way, we introduced the concept of logical package packages in a consistent way, we introduced the concept of logical package
......
...@@ -455,7 +455,7 @@ static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) ...@@ -455,7 +455,7 @@ static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
* multicore group inside a NUMA node. If this happens, we will * multicore group inside a NUMA node. If this happens, we will
* discard the MC level of the topology later. * discard the MC level of the topology later.
*/ */
static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) static bool match_pkg(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
{ {
if (c->phys_proc_id == o->phys_proc_id) if (c->phys_proc_id == o->phys_proc_id)
return true; return true;
...@@ -546,7 +546,7 @@ void set_cpu_sibling_map(int cpu) ...@@ -546,7 +546,7 @@ void set_cpu_sibling_map(int cpu)
for_each_cpu(i, cpu_sibling_setup_mask) { for_each_cpu(i, cpu_sibling_setup_mask) {
o = &cpu_data(i); o = &cpu_data(i);
if ((i == cpu) || (has_mp && match_die(c, o))) { if ((i == cpu) || (has_mp && match_pkg(c, o))) {
link_mask(topology_core_cpumask, cpu, i); link_mask(topology_core_cpumask, cpu, i);
/* /*
...@@ -570,7 +570,7 @@ void set_cpu_sibling_map(int cpu) ...@@ -570,7 +570,7 @@ void set_cpu_sibling_map(int cpu)
} else if (i != cpu && !c->booted_cores) } else if (i != cpu && !c->booted_cores)
c->booted_cores = cpu_data(i).booted_cores; c->booted_cores = cpu_data(i).booted_cores;
} }
if (match_die(c, o) && !topology_same_node(c, o)) if (match_pkg(c, o) && !topology_same_node(c, o))
x86_has_numa_in_package = true; x86_has_numa_in_package = true;
} }
......
...@@ -71,7 +71,7 @@ int _debug_hotplug_cpu(int cpu, int action) ...@@ -71,7 +71,7 @@ int _debug_hotplug_cpu(int cpu, int action)
case 0: case 0:
ret = cpu_down(cpu); ret = cpu_down(cpu);
if (!ret) { if (!ret) {
pr_info("CPU %u is now offline\n", cpu); pr_info("DEBUG_HOTPLUG_CPU0: CPU %u is now offline\n", cpu);
dev->offline = true; dev->offline = true;
kobject_uevent(&dev->kobj, KOBJ_OFFLINE); kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment