From: "tip-bot for H. Peter Anvin" <hpa@linux.intel.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
asit.k.mallick@intel.com, a.p.zijlstra@chello.hl,
arjan@linux.kernel.org, lenb@kernel.org, tglx@linutronix.de,
hpa@linux.intel.com, venki@google.com
Subject: [tip:x86/idle] x86, hotplug: Move WBINVD back outside the play_dead loop
Date: Sat, 18 Sep 2010 00:13:05 GMT [thread overview]
Message-ID: <tip-a68e5c94f7d3dd64fef34dd5d97e365cae4bb42a@git.kernel.org> (raw)
In-Reply-To: <tip-ea53069231f9317062910d6e772cca4ce93de8c8@git.kernel.org>
Commit-ID: a68e5c94f7d3dd64fef34dd5d97e365cae4bb42a
Gitweb: http://git.kernel.org/tip/a68e5c94f7d3dd64fef34dd5d97e365cae4bb42a
Author: H. Peter Anvin <hpa@linux.intel.com>
AuthorDate: Fri, 17 Sep 2010 17:06:46 -0700
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Fri, 17 Sep 2010 17:10:23 -0700
x86, hotplug: Move WBINVD back outside the play_dead loop
On processors with hyperthreading, when only one thread is offlined
the other thread can cause a spurious wakeup on the idled thread. We
do not want to re-WBINVD when that happens.
Ideally, we should simply skip WBINVD unless we're the last thread on
a particular core to shut down, but there might be similar issues
elsewhere in the system.
Thus, revert to previous behavior of only WBINVD outside the loop.
Partly as a result, remove the mb()'s around it: they are not
necessary since wbinvd() is a serializing instruction, but they were
intended to make sure the compiler didn't do any funny loop
optimizations.
Reported-by: Asit Mallick <asit.k.mallick@intel.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Arjan van de Ven <arjan@linux.kernel.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Venkatesh Pallipadi <venki@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.hl>
LKML-Reference: <tip-ea53069231f9317062910d6e772cca4ce93de8c8@git.kernel.org>
---
arch/x86/kernel/smpboot.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 07bf423..55c80ffb 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1422,9 +1422,9 @@ static inline void mwait_play_dead(void)
(highest_subcstate - 1);
}
+ wbinvd();
+
while (1) {
- mb();
- wbinvd();
__monitor(¤t_thread_info()->flags, 0, 0);
mb();
__mwait(eax, 0);
@@ -1433,11 +1433,10 @@ static inline void mwait_play_dead(void)
static inline void hlt_play_dead(void)
{
+ if (current_cpu_data.x86 >= 4)
+ wbinvd();
+
while (1) {
- mb();
- if (current_cpu_data.x86 >= 4)
- wbinvd();
- mb();
native_halt();
}
}
next prev parent reply other threads:[~2010-09-18 0:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-22 23:19 [patch 0/2] x86: Make offline cpus to go to deepest idle state using mwait venkatesh.pallipadi
2009-05-22 23:19 ` [patch 1/2] x86: Add pm_play_dead funcptr to power-efficiently offline CPUs venkatesh.pallipadi
2009-05-23 10:44 ` Peter Zijlstra
2009-05-23 15:07 ` Pallipadi, Venkatesh
2009-06-22 17:25 ` Pallipadi, Venkatesh
2009-05-22 23:19 ` [patch 2/2] x86: put offline CPUs into deepest mwait cstate_subcstate venkatesh.pallipadi
2009-05-25 0:56 ` Shaohua Li
2009-05-26 21:17 ` Pallipadi, Venkatesh
2010-09-17 23:46 ` [tip:x86/idle] x86, hotplug: Use mwait to offline a processor, fix the legacy case tip-bot for H. Peter Anvin
2010-09-18 0:13 ` tip-bot for H. Peter Anvin [this message]
2010-09-18 0:48 ` [tip:x86/idle] x86, hotplug: Move WBINVD back outside the play_dead loop Venkatesh Pallipadi
2010-09-20 18:20 ` H. Peter Anvin
2010-09-20 20:11 ` H. Peter Anvin
2010-09-20 22:34 ` Venkatesh Pallipadi
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=tip-a68e5c94f7d3dd64fef34dd5d97e365cae4bb42a@git.kernel.org \
--to=hpa@linux.intel.com \
--cc=a.p.zijlstra@chello.hl \
--cc=arjan@linux.kernel.org \
--cc=asit.k.mallick@intel.com \
--cc=hpa@zytor.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=venki@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.