Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751711AbdLDWLk (ORCPT ); Mon, 4 Dec 2017 17:11:40 -0500 Received: from terminus.zytor.com ([65.50.211.136]:49709 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751156AbdLDWLg (ORCPT ); Mon, 4 Dec 2017 17:11:36 -0500 Date: Mon, 4 Dec 2017 14:10:23 -0800 From: tip-bot for Prarit Bhargava Message-ID: Cc: prarit@redhat.com, kubakici@wp.pl, mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, williams@redhat.com Reply-To: mingo@kernel.org, kubakici@wp.pl, hpa@zytor.com, linux-kernel@vger.kernel.org, williams@redhat.com, tglx@linutronix.de, prarit@redhat.com In-Reply-To: <20171204164521.17870-1-prarit@redhat.com> References: <20171204164521.17870-1-prarit@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/smpboot: Do not use smp_num_siblings in __max_logical_packages calculation Git-Commit-ID: b1cbacc8663a4dce62e4ae501e859c82f4aeb1ca X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2010 Lines: 45 Commit-ID: b1cbacc8663a4dce62e4ae501e859c82f4aeb1ca Gitweb: https://git.kernel.org/tip/b1cbacc8663a4dce62e4ae501e859c82f4aeb1ca Author: Prarit Bhargava AuthorDate: Mon, 4 Dec 2017 11:45:21 -0500 Committer: Thomas Gleixner CommitDate: Mon, 4 Dec 2017 23:03:48 +0100 x86/smpboot: Do not use smp_num_siblings in __max_logical_packages calculation Documentation/x86/topology.txt defines smp_num_siblings as "The number of threads in a core". Since commit bbb65d2d365e ("x86: use cpuid vector 0xb when available for detecting cpu topology") smp_num_siblings is the maximum number of threads in a core. If Simultaneous MultiThreading (SMT) is disabled on a system, smp_num_siblings is 2 and not 1 as expected. Use topology_max_smt_threads(), which contains the active numer of threads, in the __max_logical_packages calculation. Fixes: b4c0a7326f5d ("x86/smpboot: Fix __max_logical_packages estimate") Reported-by: Jakub Kicinski Signed-off-by: Prarit Bhargava Tested-by: Jakub Kicinski Cc: netdev@vger.kernel.org Cc: "netdev@vger.kernel.org" Cc: Clark Williams Link: https://lkml.kernel.org/r/20171204164521.17870-1-prarit@redhat.com --- arch/x86/kernel/smpboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 05a97d5..7de0aa2 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1304,7 +1304,7 @@ void __init native_smp_cpus_done(unsigned int max_cpus) * Today neither Intel nor AMD support heterogenous systems so * extrapolate the boot cpu's data to all packages. */ - ncpus = cpu_data(0).booted_cores * smp_num_siblings; + ncpus = cpu_data(0).booted_cores * topology_max_smt_threads(); __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); pr_info("Max logical packages: %u\n", __max_logical_packages);