All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Peter Zijlstra <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, peterz@infradead.org, umgwanakikbuti@gmail.com,
	tglx@linutronix.de, mingo@kernel.org,
	linux-kernel@vger.kernel.org
Subject: [tip:x86/urgent] x86/topology: Fix Intel HT disable
Date: Sat, 19 Mar 2016 02:31:02 -0700	[thread overview]
Message-ID: <tip-63d1e995be455ae9196270eb4b789de21afd42ed@git.kernel.org> (raw)
In-Reply-To: <20160318150538.611014173@infradead.org>

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

  reply	other threads:[~2016-03-19  9:34 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-18 15:03 [PATCH 0/3] x86 topology fixes Peter Zijlstra
2016-03-18 15:03 ` [PATCH 1/3] x86/topology: Fix logical pkg mapping Peter Zijlstra
2016-03-19  9:30   ` [tip:x86/urgent] x86/topology: Fix logical package mapping tip-bot for Peter Zijlstra
2016-03-18 15:03 ` [PATCH 2/3] x86/topology: Fix AMD core count Peter Zijlstra
2016-03-18 16:41   ` Borislav Petkov
2016-03-21  3:07     ` Huang Rui
2016-03-21  3:46       ` Huang Rui
2016-03-21  8:26         ` Borislav Petkov
2016-03-21  9:18           ` Huang Rui
2016-03-21  8:56         ` Thomas Gleixner
2016-03-21  8:21       ` Peter Zijlstra
2016-03-21  9:46         ` Huang Rui
2016-03-21 13:57           ` Borislav Petkov
2016-03-22  8:10             ` Sherry Hurwitz
2016-03-22 11:22               ` Borislav Petkov
2016-03-21  8:23       ` Borislav Petkov
2016-03-21 10:05         ` Huang Rui
2016-03-21 10:23           ` Borislav Petkov
2016-03-19  9:24   ` Thomas Gleixner
2016-03-19 15:56     ` Borislav Petkov
2016-03-20 10:39     ` Peter Zijlstra
2016-03-20 11:04       ` Borislav Petkov
2016-03-20 12:32         ` Peter Zijlstra
2016-03-20 12:46           ` Peter Zijlstra
2016-03-20 13:09             ` Borislav Petkov
2016-03-20 17:08               ` Peter Zijlstra
2016-03-20 18:46                 ` Borislav Petkov
2016-03-29  8:49             ` [tip:x86/urgent] perf/x86/amd: Cleanup Fam10h NB event constraints tip-bot for Peter Zijlstra
2016-03-22  7:56   ` [PATCH 2/3] x86/topology: Fix AMD core count Huang Rui
2016-03-18 15:03 ` [PATCH 3/3] x86/topology: Fix Intel HT disable Peter Zijlstra
2016-03-19  9:31   ` tip-bot for Peter Zijlstra [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-03-16  6:48 4.5.0+ panic when setup loop device Xiong Zhou
2016-03-16 15:26 ` Thomas Gleixner
2016-03-17  1:56   ` Xiong Zhou
2016-03-17  9:52     ` Peter Zijlstra
2016-03-17  9:56       ` Peter Zijlstra
2016-03-17 10:21       ` Thomas Gleixner
2016-03-17 10:26         ` Peter Zijlstra
2016-03-17 11:39           ` Thomas Gleixner
2016-03-17 11:51             ` Peter Zijlstra
2016-03-17 11:57               ` Borislav Petkov
2016-03-17 12:01               ` Thomas Gleixner
2016-03-17 16:42                 ` Jens Axboe
2016-03-17 18:26                   ` Jens Axboe
2016-03-17 20:20                     ` Thomas Gleixner
2016-03-17 20:23                       ` Jens Axboe
2016-03-17 20:30                         ` Thomas Gleixner
2016-03-17 20:41                           ` Jens Axboe
2016-03-18  2:31             ` Xiong Zhou
2016-03-18  4:11       ` Mike Galbraith
2016-03-18  7:51         ` Peter Zijlstra
2016-03-18 10:15         ` Peter Zijlstra
2016-03-18 12:39           ` Mike Galbraith
2016-03-18 13:32             ` Peter Zijlstra
2016-03-18 14:07               ` Mike Galbraith
2016-03-18 11:55         ` Thomas Gleixner
2016-03-18 12:39           ` Mike Galbraith
2016-03-19  9:31           ` [tip:x86/urgent] x86/topology: Use total_cpus not nr_cpu_ids for logical packages tip-bot for Thomas Gleixner
2016-03-29  8:48       ` [tip:x86/urgent] x86/topology: Fix AMD core count tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-63d1e995be455ae9196270eb4b789de21afd42ed@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=umgwanakikbuti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.