Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360721

[PATCH 3/3] x86/topology: Fix Intel HT disable

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 3/3] x86/topology: Fix Intel HT disable
Date 2016-03-18 16:10 +0100
Message-ID <re4ci-8fa-13@gated-at.bofh.it> (permalink)
References <re4ci-8fa-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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);
 
 	/*

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[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

csiph-web