From: Igor Mammedov <imammedo@redhat.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Joe Mario <jmario@redhat.com>, Jiri Kosina <jkosina@suse.cz>,
Peter Zijlstra <peterz@infradead.org>,
linux-kernel@vger.kernel.org
Subject: cpu/hotplug: broken sibling thread hotplug
Date: Thu, 24 Jan 2019 16:57:13 +0100 [thread overview]
Message-ID: <20190124165713.2b0b37ed@redhat.com> (raw)
In case guest is booted with one CPU present and then later
a sibling CPU is hotplugged [1], it stays offline since SMT
is disabled.
Bisects to
73d5e2b47264 ("cpu/hotplug: detect SMT disabled by BIOS")
which used __max_smt_threads to decide disabling SMT and in
case [1] only primary CPU thread is present hence SMT
is disabled.
Later bc2d8d262cba (cpu/hotplug: Fix SMT supported evaluation),
rewrites code path but evaluation criteria still depends on
sibling thread being present at boot time, so problem persist.
1) QEMU -smp 1,sockets=2,cores=1,threads=2 -monitor stdio ...
# hotplug sibling thread
(qemu) device_add qemu64-x86_64-cpu,socket-id=0,core-id=0,thread-id=1
I've failed to find reasoning behind statement:
"
cpu/hotplug: detect SMT disabled by BIOS
If SMT is disabled in BIOS, the CPU code doesn't properly detect it.
"
Question is
1: why cpu_smt_check_topology_early() at check_bugs()
wasn't sufficient to detect SMT disabled in BIOS and
2: why side-effect of present at boot siblings were used
to keep SMT enabled?
Following quick hack fixes the sibling issue but that's
effectively means reverting both above mentioned so we are
back to the original issue "If SMT is disabled in BIOS, ..."
which roots I weren't able to locate.
---
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 91d5c38..44df8cd 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -415,7 +415,7 @@ void __init cpu_smt_check_topology_early(void)
*/
void __init cpu_smt_check_topology(void)
{
- if (!cpu_smt_available)
+ if (!topology_smt_supported())
cpu_smt_control = CPU_SMT_NOT_SUPPORTED;
}
---
next reply other threads:[~2019-01-24 15:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-24 15:57 Igor Mammedov [this message]
2019-01-25 16:36 ` cpu/hotplug: broken sibling thread hotplug Josh Poimboeuf
2019-01-25 17:02 ` Josh Poimboeuf
2019-01-28 10:13 ` Igor Mammedov
2019-01-28 12:52 ` Josh Poimboeuf
2019-01-28 13:35 ` Igor Mammedov
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=20190124165713.2b0b37ed@redhat.com \
--to=imammedo@redhat.com \
--cc=jkosina@suse.cz \
--cc=jmario@redhat.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox