diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 19:33:06 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 19:33:06 -0400 |
| commit | 948a64995aca6820abefd17f1a4258f5835c5ad9 (patch) | |
| tree | 4759a88059334793d2799655febbce312ee0f393 | |
| parent | db10ad041b318a07985363e243742a07f4b0f44b (diff) | |
| parent | 8fea0f59e97df3b9b8d2a76af54f633f4586751b (diff) | |
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
| -rw-r--r-- | Documentation/cputopology.txt | 46 | ||||
| -rw-r--r-- | Documentation/x86/topology.txt | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/smpboot.c | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/topology.c | 2 |
4 files changed, 28 insertions, 28 deletions
diff --git a/Documentation/cputopology.txt b/Documentation/cputopology.txt index c6e7e9196a8b..cb61277e2308 100644 --- a/Documentation/cputopology.txt +++ b/Documentation/cputopology.txt | |||
| @@ -3,79 +3,79 @@ How CPU topology info is exported via sysfs | |||
| 3 | =========================================== | 3 | =========================================== |
| 4 | 4 | ||
| 5 | Export CPU topology info via sysfs. Items (attributes) are similar | 5 | Export CPU topology info via sysfs. Items (attributes) are similar |
| 6 | to /proc/cpuinfo output of some architectures: | 6 | to /proc/cpuinfo output of some architectures. They reside in |
| 7 | /sys/devices/system/cpu/cpuX/topology/: | ||
| 7 | 8 | ||
| 8 | 1) /sys/devices/system/cpu/cpuX/topology/physical_package_id: | 9 | physical_package_id: |
| 9 | 10 | ||
| 10 | physical package id of cpuX. Typically corresponds to a physical | 11 | physical package id of cpuX. Typically corresponds to a physical |
| 11 | socket number, but the actual value is architecture and platform | 12 | socket number, but the actual value is architecture and platform |
| 12 | dependent. | 13 | dependent. |
| 13 | 14 | ||
| 14 | 2) /sys/devices/system/cpu/cpuX/topology/core_id: | 15 | core_id: |
| 15 | 16 | ||
| 16 | the CPU core ID of cpuX. Typically it is the hardware platform's | 17 | the CPU core ID of cpuX. Typically it is the hardware platform's |
| 17 | identifier (rather than the kernel's). The actual value is | 18 | identifier (rather than the kernel's). The actual value is |
| 18 | architecture and platform dependent. | 19 | architecture and platform dependent. |
| 19 | 20 | ||
| 20 | 3) /sys/devices/system/cpu/cpuX/topology/book_id: | 21 | book_id: |
| 21 | 22 | ||
| 22 | the book ID of cpuX. Typically it is the hardware platform's | 23 | the book ID of cpuX. Typically it is the hardware platform's |
| 23 | identifier (rather than the kernel's). The actual value is | 24 | identifier (rather than the kernel's). The actual value is |
| 24 | architecture and platform dependent. | 25 | architecture and platform dependent. |
| 25 | 26 | ||
| 26 | 4) /sys/devices/system/cpu/cpuX/topology/drawer_id: | 27 | drawer_id: |
| 27 | 28 | ||
| 28 | the drawer ID of cpuX. Typically it is the hardware platform's | 29 | the drawer ID of cpuX. Typically it is the hardware platform's |
| 29 | identifier (rather than the kernel's). The actual value is | 30 | identifier (rather than the kernel's). The actual value is |
| 30 | architecture and platform dependent. | 31 | architecture and platform dependent. |
| 31 | 32 | ||
| 32 | 5) /sys/devices/system/cpu/cpuX/topology/thread_siblings: | 33 | thread_siblings: |
| 33 | 34 | ||
| 34 | internal kernel map of cpuX's hardware threads within the same | 35 | internal kernel map of cpuX's hardware threads within the same |
| 35 | core as cpuX. | 36 | core as cpuX. |
| 36 | 37 | ||
| 37 | 6) /sys/devices/system/cpu/cpuX/topology/thread_siblings_list: | 38 | thread_siblings_list: |
| 38 | 39 | ||
| 39 | human-readable list of cpuX's hardware threads within the same | 40 | human-readable list of cpuX's hardware threads within the same |
| 40 | core as cpuX. | 41 | core as cpuX. |
| 41 | 42 | ||
| 42 | 7) /sys/devices/system/cpu/cpuX/topology/core_siblings: | 43 | core_siblings: |
| 43 | 44 | ||
| 44 | internal kernel map of cpuX's hardware threads within the same | 45 | internal kernel map of cpuX's hardware threads within the same |
| 45 | physical_package_id. | 46 | physical_package_id. |
| 46 | 47 | ||
| 47 | 8) /sys/devices/system/cpu/cpuX/topology/core_siblings_list: | 48 | core_siblings_list: |
| 48 | 49 | ||
| 49 | human-readable list of cpuX's hardware threads within the same | 50 | human-readable list of cpuX's hardware threads within the same |
| 50 | physical_package_id. | 51 | physical_package_id. |
| 51 | 52 | ||
| 52 | 9) /sys/devices/system/cpu/cpuX/topology/book_siblings: | 53 | book_siblings: |
| 53 | 54 | ||
| 54 | internal kernel map of cpuX's hardware threads within the same | 55 | internal kernel map of cpuX's hardware threads within the same |
| 55 | book_id. | 56 | book_id. |
| 56 | 57 | ||
| 57 | 10) /sys/devices/system/cpu/cpuX/topology/book_siblings_list: | 58 | book_siblings_list: |
| 58 | 59 | ||
| 59 | human-readable list of cpuX's hardware threads within the same | 60 | human-readable list of cpuX's hardware threads within the same |
| 60 | book_id. | 61 | book_id. |
| 61 | 62 | ||
| 62 | 11) /sys/devices/system/cpu/cpuX/topology/drawer_siblings: | 63 | drawer_siblings: |
| 63 | 64 | ||
| 64 | internal kernel map of cpuX's hardware threads within the same | 65 | internal kernel map of cpuX's hardware threads within the same |
| 65 | drawer_id. | 66 | drawer_id. |
| 66 | 67 | ||
| 67 | 12) /sys/devices/system/cpu/cpuX/topology/drawer_siblings_list: | 68 | drawer_siblings_list: |
| 68 | 69 | ||
| 69 | human-readable list of cpuX's hardware threads within the same | 70 | human-readable list of cpuX's hardware threads within the same |
| 70 | drawer_id. | 71 | drawer_id. |
| 71 | 72 | ||
| 72 | To implement it in an architecture-neutral way, a new source file, | 73 | Architecture-neutral, drivers/base/topology.c, exports these attributes. |
| 73 | drivers/base/topology.c, is to export the 6 to 12 attributes. The book | 74 | However, the book and drawer related sysfs files will only be created if |
| 74 | and drawer related sysfs files will only be created if CONFIG_SCHED_BOOK | 75 | CONFIG_SCHED_BOOK and CONFIG_SCHED_DRAWER are selected, respectively. |
| 75 | and CONFIG_SCHED_DRAWER are selected. | ||
| 76 | 76 | ||
| 77 | CONFIG_SCHED_BOOK and CONFIG_DRAWER are currently only used on s390, where | 77 | CONFIG_SCHED_BOOK and CONFIG_SCHED_DRAWER are currently only used on s390, |
| 78 | they reflect the cpu and cache hierarchy. | 78 | where they reflect the cpu and cache hierarchy. |
| 79 | 79 | ||
| 80 | For an architecture to support this feature, it must define some of | 80 | For an architecture to support this feature, it must define some of |
| 81 | these macros in include/asm-XXX/topology.h:: | 81 | these macros in include/asm-XXX/topology.h:: |
| @@ -98,10 +98,10 @@ To be consistent on all architectures, include/linux/topology.h | |||
| 98 | provides default definitions for any of the above macros that are | 98 | provides default definitions for any of the above macros that are |
| 99 | not defined by include/asm-XXX/topology.h: | 99 | not defined by include/asm-XXX/topology.h: |
| 100 | 100 | ||
| 101 | 1) physical_package_id: -1 | 101 | 1) topology_physical_package_id: -1 |
| 102 | 2) core_id: 0 | 102 | 2) topology_core_id: 0 |
| 103 | 3) sibling_cpumask: just the given CPU | 103 | 3) topology_sibling_cpumask: just the given CPU |
| 104 | 4) core_cpumask: just the given CPU | 104 | 4) topology_core_cpumask: just the given CPU |
| 105 | 105 | ||
| 106 | For architectures that don't support books (CONFIG_SCHED_BOOK) there are no | 106 | For architectures that don't support books (CONFIG_SCHED_BOOK) there are no |
| 107 | default definitions for topology_book_id() and topology_book_cpumask(). | 107 | default definitions for topology_book_id() and topology_book_cpumask(). |
diff --git a/Documentation/x86/topology.txt b/Documentation/x86/topology.txt index 2953e3ec9a02..06b3cdbc4048 100644 --- a/Documentation/x86/topology.txt +++ b/Documentation/x86/topology.txt | |||
| @@ -51,7 +51,7 @@ The topology of a system is described in the units of: | |||
| 51 | The physical ID of the package. This information is retrieved via CPUID | 51 | The physical ID of the package. This information is retrieved via CPUID |
| 52 | and deduced from the APIC IDs of the cores in the package. | 52 | and deduced from the APIC IDs of the cores in the package. |
| 53 | 53 | ||
| 54 | - cpuinfo_x86.logical_id: | 54 | - cpuinfo_x86.logical_proc_id: |
| 55 | 55 | ||
| 56 | The logical ID of the package. As we do not trust BIOSes to enumerate the | 56 | The logical ID of the package. As we do not trust BIOSes to enumerate the |
| 57 | packages in a consistent way, we introduced the concept of logical package | 57 | packages in a consistent way, we introduced the concept of logical package |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index c92b21f9e9dc..73e69aaaa117 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -455,7 +455,7 @@ static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) | |||
| 455 | * multicore group inside a NUMA node. If this happens, we will | 455 | * multicore group inside a NUMA node. If this happens, we will |
| 456 | * discard the MC level of the topology later. | 456 | * discard the MC level of the topology later. |
| 457 | */ | 457 | */ |
| 458 | static bool match_die(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) | 458 | static bool match_pkg(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) |
| 459 | { | 459 | { |
| 460 | if (c->phys_proc_id == o->phys_proc_id) | 460 | if (c->phys_proc_id == o->phys_proc_id) |
| 461 | return true; | 461 | return true; |
| @@ -546,7 +546,7 @@ void set_cpu_sibling_map(int cpu) | |||
| 546 | for_each_cpu(i, cpu_sibling_setup_mask) { | 546 | for_each_cpu(i, cpu_sibling_setup_mask) { |
| 547 | o = &cpu_data(i); | 547 | o = &cpu_data(i); |
| 548 | 548 | ||
| 549 | if ((i == cpu) || (has_mp && match_die(c, o))) { | 549 | if ((i == cpu) || (has_mp && match_pkg(c, o))) { |
| 550 | link_mask(topology_core_cpumask, cpu, i); | 550 | link_mask(topology_core_cpumask, cpu, i); |
| 551 | 551 | ||
| 552 | /* | 552 | /* |
| @@ -570,7 +570,7 @@ void set_cpu_sibling_map(int cpu) | |||
| 570 | } else if (i != cpu && !c->booted_cores) | 570 | } else if (i != cpu && !c->booted_cores) |
| 571 | c->booted_cores = cpu_data(i).booted_cores; | 571 | c->booted_cores = cpu_data(i).booted_cores; |
| 572 | } | 572 | } |
| 573 | if (match_die(c, o) && !topology_same_node(c, o)) | 573 | if (match_pkg(c, o) && !topology_same_node(c, o)) |
| 574 | x86_has_numa_in_package = true; | 574 | x86_has_numa_in_package = true; |
| 575 | } | 575 | } |
| 576 | 576 | ||
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index 738bf42b0218..be5bc2e47c71 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c | |||
| @@ -71,7 +71,7 @@ int _debug_hotplug_cpu(int cpu, int action) | |||
| 71 | case 0: | 71 | case 0: |
| 72 | ret = cpu_down(cpu); | 72 | ret = cpu_down(cpu); |
| 73 | if (!ret) { | 73 | if (!ret) { |
| 74 | pr_info("CPU %u is now offline\n", cpu); | 74 | pr_info("DEBUG_HOTPLUG_CPU0: CPU %u is now offline\n", cpu); |
| 75 | dev->offline = true; | 75 | dev->offline = true; |
| 76 | kobject_uevent(&dev->kobj, KOBJ_OFFLINE); | 76 | kobject_uevent(&dev->kobj, KOBJ_OFFLINE); |
| 77 | } else | 77 | } else |
