Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1360721 > unrolled thread
| Started by | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| First post | 2016-03-18 16:10 +0100 |
| Last post | 2016-03-19 10:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 3/3] x86/topology: Fix Intel HT disable Peter Zijlstra <peterz@infradead.org> - 2016-03-18 16:10 +0100
[tip:x86/urgent] x86/topology: Fix Intel HT disable tip-bot for Peter Zijlstra <tipbot@zytor.com> - 2016-03-19 10:40 +0100
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2016-03-18 16:10 +0100 |
| Subject | [PATCH 3/3] x86/topology: Fix Intel HT disable |
| Message-ID | <re4ci-8fa-13@gated-at.bofh.it> |
As per the comment below; due to BIOS it is sometimes impossible to know if there actually are smp siblings until the machine is fully enumerated. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> --- arch/x86/kernel/smpboot.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -312,8 +312,21 @@ static void __init smp_init_package_map( /* * Today neither Intel nor AMD support heterogenous systems. That * might change in the future.... + * + * While ideally we'd want '* smp_num_siblings' in the below @ncpus + * computation, this won't actually work since some Intel BIOSes + * report inconsistent HT data when they disable HT. + * + * In particular, they reduce the APIC-IDs to only include the cores, + * but leave the CPUID topology to say there are (2) siblings. + * This means we don't know how many threads there will be until + * after the APIC enumeration. + * + * By not including this we'll sometimes over-estimate the number of + * logical packages by the amount of !present siblings, but this is + * still better than MAX_LOCAL_APIC. */ - ncpus = boot_cpu_data.x86_max_cores * smp_num_siblings; + ncpus = boot_cpu_data.x86_max_cores; __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); /*
[toc] | [next] | [standalone]
| From | tip-bot for Peter Zijlstra <tipbot@zytor.com> |
|---|---|
| Date | 2016-03-19 10:40 +0100 |
| Subject | [tip:x86/urgent] x86/topology: Fix Intel HT disable |
| Message-ID | <relwt-6mG-11@gated-at.bofh.it> |
| In reply to | #1360721 |
Commit-ID: 63d1e995be455ae9196270eb4b789de21afd42ed
Gitweb: http://git.kernel.org/tip/63d1e995be455ae9196270eb4b789de21afd42ed
Author: Peter Zijlstra <peterz@infradead.org>
AuthorDate: Fri, 18 Mar 2016 16:03:48 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Sat, 19 Mar 2016 10:26:40 +0100
x86/topology: Fix Intel HT disable
As per the comment in the code; due to BIOS it is sometimes impossible to know
if there actually are smp siblings until the machine is fully enumerated. So
we rather overestimate the number of possible packages.
Fixes: 1f12e32f4cd5 ("x86/topology: Create logical package id")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: aherrmann@suse.com
Cc: jencce.kernel@gmail.com
Cc: bp@alien8.de
Cc: Mike Galbraith <umgwanakikbuti@gmail.com>
Link: http://lkml.kernel.org/r/20160318150538.611014173@infradead.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
arch/x86/kernel/smpboot.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 64b669d..81e6a43 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -312,8 +312,21 @@ static void __init smp_init_package_map(void)
/*
* Today neither Intel nor AMD support heterogenous systems. That
* might change in the future....
+ *
+ * While ideally we'd want '* smp_num_siblings' in the below @ncpus
+ * computation, this won't actually work since some Intel BIOSes
+ * report inconsistent HT data when they disable HT.
+ *
+ * In particular, they reduce the APIC-IDs to only include the cores,
+ * but leave the CPUID topology to say there are (2) siblings.
+ * This means we don't know how many threads there will be until
+ * after the APIC enumeration.
+ *
+ * By not including this we'll sometimes over-estimate the number of
+ * logical packages by the amount of !present siblings, but this is
+ * still better than MAX_LOCAL_APIC.
*/
- ncpus = boot_cpu_data.x86_max_cores * smp_num_siblings;
+ ncpus = boot_cpu_data.x86_max_cores;
__max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus);
/*
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web