Fixes for smp_num_siblings calculation
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 0 repliesNew
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | x86, Clean up smp_num_siblings calculationarch/ arch/ arch/ +1 more | +19 | 0 replies | |
| 2/2 | x86, disable ht flag when hyperthreading is disabledarch/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/2] Fixes for smp_num_siblings calculation
I have a system on which I have disabled threading in the BIOS, and I am booting the kernel with the option "idle=poll".
The kernel displays
process: WARNING: polling idle and HT enabled, performance may degrade
which is incorrect -- I've already disabled HT.
This warning is issued here:
void select_idle_routine(const struct cpuinfo_x86 *c)
{
if (boot_option_idle_override == IDLE_POLL && smp_num_siblings > 1)
pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n");Quoted 1 line
From my understanding of the other areas of kernel that use
smp_num_siblings,
the value is supposed to be the actual number of threads per core, and this value of smp_num_siblings is incorrect. In theory, it should be 1 but it is reported as 2. When I looked into how smp_num_siblings is calculated I found the following call sequence in the kernel:
start_kernel ->
check_bugs ->
identify_boot_cpu ->
identify_cpu ->
c_init = init_intel
init_intel ->
detect_extended_topology
(sets value)
OR
c_init = init_amd
init_amd -> amd_detect_cmp
-> amd_get_topology
(sets value)
-> detect_ht()
... (sets value)
detect_ht()
(also sets value)ie) it is confusing to figure out where smp_num_siblings is set, and AFAICT, it is set to the "factory reported" value.
This patchset sets smp_num_siblings to the expected value of the actual number of siblings each core has. The 2/2 patchset, disables the "ht" flag if each core has only one sibling.
Prarit Bhargava (2):
x86, Clean up smp_num_siblings calculation x86, disable ht flag when hyperthreading is disabled
arch/x86/kernel/cpu/amd.c | 1 - arch/x86/kernel/cpu/common.c | 23 +++++++++++------------ arch/x86/kernel/cpu/topology.c | 2 +- arch/x86/kernel/smpboot.c | 14 +++++++++++--- 4 files changed, 23 insertions(+), 17 deletions(-)
Signature · 1 line
1.7.9.3