From: Jiri Olsa <jolsa@kernel.org>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: "Jean-Pierre Lozi" <jplozi@unice.fr>,
"Jirka Hladky" <jhladky@redhat.com>,
"Petr Surý" <psury@redhat.com>,
lkml <linux-kernel@vger.kernel.org>,
"Ingo Molnar" <mingo@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: [PATCH] x86/topology: Fallback to SMT level only once
Date: Sun, 28 Aug 2016 20:19:46 +0200 [thread overview]
Message-ID: <1472408386-5254-1-git-send-email-jolsa@kernel.org> (raw)
Jirka, Peter and Jean-Pierre reported performance drop on
some cpus after making cpu offline and online again.
The reason is the kernel logic that falls back to SMT
level topology if more than one node is detected within
CPU package. During the system boot this logic cuts out
the DIE topology level and numa code adds NUMA level
on top of this.
After the boot if you reboot make the cpu offline and online
again, this logic resets the SMT level topology, removing
whole NUMA level stuff.
Ensuring the SMT topology fallback happens only once during
the boot so the NUMA topology level is kept once it's built.
This problem is one of the issues reported in the wastedcores
article [1]. There's similar patch to this issue attached
to the article [2].
[1] https://github.com/jplozi/wastedcores
[2] https://github.com/jplozi/wastedcores/blob/master/patches/missing_sched_domains_linux_4.1.patch
Cc: Jean-Pierre Lozi <jplozi@unice.fr>
Cc: Jirka Hladky <jhladky@redhat.com>
Cc: Petr Surý <psury@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
arch/x86/kernel/smpboot.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2a6e84a30a54..f2a769b2b3fe 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -487,7 +487,17 @@ static struct sched_domain_topology_level numa_inside_package_topology[] = {
*/
static void primarily_use_numa_for_topology(void)
{
- set_sched_topology(numa_inside_package_topology);
+ static bool once;
+
+ /*
+ * We need to run it only during boot, once we are
+ * here due to getting cpu online again we have already
+ * NUMA topology setup done.
+ */
+ if (!once) {
+ set_sched_topology(numa_inside_package_topology);
+ once = true;
+ }
}
void set_cpu_sibling_map(int cpu)
--
2.7.4
next reply other threads:[~2016-08-28 18:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-28 18:19 Jiri Olsa [this message]
2016-08-29 10:40 ` [PATCH] x86/topology: Fallback to SMT level only once Peter Zijlstra
2016-08-29 11:09 ` Jiri Olsa
2016-08-29 12:20 ` Jirka Hladky
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=1472408386-5254-1-git-send-email-jolsa@kernel.org \
--to=jolsa@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=hpa@zytor.com \
--cc=jhladky@redhat.com \
--cc=jplozi@unice.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=psury@redhat.com \
--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