]> git.baikalelectronics.ru Git - kernel.git/commit
x86/smpboot: Do not use smp_num_siblings in __max_logical_packages calculation
authorPrarit Bhargava <prarit@redhat.com>
Mon, 4 Dec 2017 16:45:21 +0000 (11:45 -0500)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 7 Dec 2017 09:28:22 +0000 (10:28 +0100)
commit50102432131803a7101b12442062bf9403245df8
tree5b727713b606ec88fc5d085249526f48fa7c1dfb
parent986b67fd3956eb8da7d65200e273f0ef2e04ea67
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 197c15c68a0c ("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.

On a single socket, single core, single thread system __max_smt_threads has
not been updated when the __max_logical_packages calculation happens, so its
zero which makes the package estimate fail. Initialize it to one, which is
the minimum number of threads on a core.

[ tglx: Folded the __max_smt_threads fix in ]

Fixes: 35abf9732c48 ("x86/smpboot: Fix __max_logical_packages estimate")
Reported-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Prarit Bhargava <prarit@redhat.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Jakub Kicinski <kubakici@wp.pl>
Cc: netdev@vger.kernel.org
Cc: "netdev@vger.kernel.org"
Cc: Clark Williams <williams@redhat.com>
Link: https://lkml.kernel.org/r/20171204164521.17870-1-prarit@redhat.com
arch/x86/kernel/smpboot.c