* FAILED: patch "[PATCH] sched/idle/x86: Optimize unnecessary mwait_idle() resched" failed to apply to 3.10-stable tree
@ 2015-04-29 11:57 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-04-29 11:57 UTC (permalink / raw)
To: bitbucket, bp, efault, hpa, ibmalone, jwboyer, len.brown, lenb,
mingo, peterz, stable, tglx, torvalds
Cc: stable
The patch below does not apply to the 3.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From f8e617f4582995f7c25ef25b4167213120ad122b Mon Sep 17 00:00:00 2001
From: Mike Galbraith <bitbucket@online.de>
Date: Sat, 18 Jan 2014 17:14:44 +0100
Subject: [PATCH] sched/idle/x86: Optimize unnecessary mwait_idle() resched
IPIs
To fully take advantage of MWAIT, apparently the CLFLUSH instruction needs
another quirk on certain CPUs: proper barriers around it on certain machines.
On a Q6600 SMP system, pipe-test scheduling performance, cross core,
improves significantly:
3.8.13 487.2 KHz 1.000
3.13.0-master 415.5 KHz .852
3.13.0-master+ 415.2 KHz .852 + restore mwait_idle
3.13.0-master++ 488.5 KHz 1.002 + restore mwait_idle + IPI fix
Since X86_BUG_CLFLUSH_MONITOR is already a quirk, don't create a separate
quirk for the extra smp_mb()s.
Signed-off-by: Mike Galbraith <bitbucket@online.de>
Cc: <stable@vger.kernel.org> # 3.10+
Cc: Borislav Petkov <bp@alien8.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Ian Malone <ibmalone@gmail.com>
Cc: Josh Boyer <jwboyer@redhat.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1390061684.5566.4.camel@marge.simpson.net
[ Ported to recent kernel, added comments about the quirk. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index da06f741d2a6..6ad8a6396b75 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -428,18 +428,22 @@ static int prefer_mwait_c1_over_halt(const struct cpuinfo_x86 *c)
static void mwait_idle(void)
{
- if (!need_resched()) {
- if (this_cpu_has(X86_BUG_CLFLUSH_MONITOR))
+ if (!current_set_polling_and_test()) {
+ if (this_cpu_has(X86_BUG_CLFLUSH_MONITOR)) {
+ smp_mb(); /* quirk */
clflush((void *)¤t_thread_info()->flags);
+ smp_mb(); /* quirk */
+ }
__monitor((void *)¤t_thread_info()->flags, 0, 0);
- smp_mb();
if (!need_resched())
__sti_mwait(0, 0);
else
local_irq_enable();
- } else
+ } else {
local_irq_enable();
+ }
+ __current_clr_polling();
}
void select_idle_routine(const struct cpuinfo_x86 *c)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-04-29 11:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-29 11:57 FAILED: patch "[PATCH] sched/idle/x86: Optimize unnecessary mwait_idle() resched" failed to apply to 3.10-stable tree gregkh
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.