All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Galbraith <bitbucket@online.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>, Len Brown <lenb@kernel.org>,
	Linux PM list <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Jeremy Eder <jeder@redhat.com>,
	x86@kernel.org
Subject: Re: 50 Watt idle power regression bisected to Linux-3.10
Date: Wed, 11 Dec 2013 13:29:15 +0100	[thread overview]
Message-ID: <1386764955.12005.60.camel@marge.simpson.net> (raw)
In-Reply-To: <20131211115239.GA21999@twins.programming.kicks-ass.net>

On Wed, 2013-12-11 at 12:52 +0100, Peter Zijlstra wrote: 
> On Wed, Dec 11, 2013 at 12:38:39PM +0100, Borislav Petkov wrote:
> > Right, if it turns out that this is really the case and that this
> > erratum hasn't been fixed for models later than 29 - we'd need the
> > additional model numbers to set X86_FEATURE_CLFLUSH_MONITOR correctly.
> 
> You also need: https://lkml.org/lkml/2013/11/19/143
> 
> Because obviously not all mwait idle loops check that cpu bit.

I had tried that patch, to see if it would magically make the thing
start working, nope.  I had also tried...

---
 drivers/idle/intel_idle.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/idle/intel_idle.c
===================================================================
--- linux-2.6.orig/drivers/idle/intel_idle.c
+++ linux-2.6/drivers/idle/intel_idle.c
@@ -376,11 +376,14 @@ static int intel_idle(struct cpuidle_dev
 		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu);
 
 	if (!current_set_polling_and_test()) {
-
+		if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
+			clflush((void *)&current_thread_info()->flags);
 		__monitor((void *)&current_thread_info()->flags, 0, 0);
 		smp_mb();
 		if (!need_resched())
 			__mwait(eax, ecx);
+		if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
+			clflush((void *)&current_thread_info()->flags);
 	}
 
 	if (!(lapic_timer_reliable_states & (1 << (cstate))))

..a cflush before _and_ after, among other (shazam!.. darn) guesses, but
nogo.  Turning that into the tglx one liner indeed did fix the thing, as
did adding this to your patch.

---
 arch/x86/include/asm/mwait.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/arch/x86/include/asm/mwait.h
===================================================================
--- linux-2.6.orig/arch/x86/include/asm/mwait.h
+++ linux-2.6/arch/x86/include/asm/mwait.h
@@ -43,7 +43,7 @@ static inline void __mwait(unsigned long
 static inline void mwait_idle_with_hints(unsigned long eax, unsigned long ecx)
 {
 	if (!current_set_polling_and_test()) {
-		if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
+//		if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
 			clflush((void *)&current_thread_info()->flags);
 
 		__monitor((void *)&current_thread_info()->flags, 0, 0);



Grrr.

flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe
syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl
xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2
ssse3 cx16 xtpr pdcm dca sse4_1 sse4_2 x2apic popcnt lahf_lm dtherm
tpr_shadow vnmi flexpriority ept vpid

-Mike


  reply	other threads:[~2013-12-11 12:30 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-07  8:00 50 Watt idle power regression bisected to Linux-3.10 Len Brown
2013-12-07  8:39 ` Mike Galbraith
2013-12-07 16:01   ` Len Brown
2013-12-07 16:45     ` Len Brown
2013-12-07 19:17       ` Mike Galbraith
2013-12-10 11:41         ` Ingo Molnar
2013-12-07 12:54 ` Thomas Gleixner
2013-12-08  4:57 ` Mike Galbraith
2013-12-08 20:40   ` Len Brown
2013-12-09  3:16     ` Mike Galbraith
2013-12-10  5:17       ` Mike Galbraith
2013-12-10 11:45         ` Ingo Molnar
2013-12-10 14:29         ` Thomas Gleixner
2013-12-10 15:06           ` Ingo Molnar
2013-12-11  2:05           ` Thomas Gleixner
2013-12-11  3:21             ` Mike Galbraith
2013-12-11 11:28               ` Thomas Gleixner
2013-12-11 11:38                 ` Borislav Petkov
2013-12-11 11:52                   ` Peter Zijlstra
2013-12-11 12:29                     ` Mike Galbraith [this message]
2013-12-11 12:43                       ` Peter Zijlstra
2013-12-11 13:10                         ` Mike Galbraith
2013-12-11 13:40                         ` Borislav Petkov
2013-12-11 14:56                           ` Ingo Molnar
2013-12-11 16:02                             ` Borislav Petkov
2013-12-11 16:43                             ` Peter Zijlstra
2013-12-11 17:50                               ` Ingo Molnar
2013-12-11 23:08                                 ` H. Peter Anvin
2013-12-11 23:14                                   ` Borislav Petkov
2013-12-12  0:52                                     ` H. Peter Anvin
2013-12-12  4:25                                       ` Mike Galbraith
2013-12-12  4:49                                         ` H. Peter Anvin
2013-12-12  4:59                                           ` Mike Galbraith
2013-12-12  5:37                                           ` Mike Galbraith
2013-12-12  5:45                                             ` H. Peter Anvin
2013-12-12  5:57                                               ` Mike Galbraith
2013-12-12  6:05                                                 ` Mike Galbraith
2013-12-12  7:57                                                   ` H. Peter Anvin
2013-12-12  8:51                                   ` Peter Zijlstra
2013-12-12 13:28                                     ` Ingo Molnar
2013-12-12 15:06                                       ` H. Peter Anvin
2013-12-12 15:51                                         ` Peter Zijlstra
2013-12-11 14:42                         ` Ingo Molnar
2013-12-11 15:02                           ` Thomas Gleixner
2013-12-11 15:09                             ` Ingo Molnar
2013-12-11 16:44                               ` Peter Zijlstra
2013-12-11 17:48                                 ` Ingo Molnar
2013-12-11 16:44                           ` Peter Zijlstra
2013-12-11 17:47                             ` Ingo Molnar
2013-12-11 21:43                     ` Len Brown
2013-12-11 22:22                       ` Thomas Gleixner
2013-12-18 21:44 ` [PATCH] x86 idle: repair large-server 50-watt idle-power regression Len Brown
2013-12-18 21:44   ` Len Brown
2013-12-19 12:22   ` Ingo Molnar
2013-12-19 14:40     ` H. Peter Anvin
2013-12-19 15:45       ` Borislav Petkov
2013-12-19 15:55     ` H. Peter Anvin
2013-12-19 16:02       ` Ingo Molnar
2013-12-19 16:09         ` H. Peter Anvin
2013-12-19 16:13         ` H. Peter Anvin
2013-12-19 16:21           ` Peter Zijlstra
2013-12-19 16:50             ` H. Peter Anvin
2013-12-19 17:07               ` Ingo Molnar
2013-12-19 17:25                 ` Peter Zijlstra
2013-12-19 17:36                   ` Peter Zijlstra
2013-12-19 18:05                     ` H. Peter Anvin
2013-12-19 18:14                       ` Ingo Molnar
2013-12-19 17:50                   ` Peter Zijlstra
2013-12-19 18:18                     ` Ingo Molnar
2013-12-19 21:05                       ` H. Peter Anvin
2013-12-19 21:17                         ` Ingo Molnar
2013-12-19 18:10                   ` Ingo Molnar
2013-12-19 18:09                 ` H. Peter Anvin
2013-12-19 18:19                   ` H. Peter Anvin
2013-12-19 18:23                     ` Ingo Molnar
     [not found]                       ` <CA+55aFzGxcML7j8CEvQPYzh0W81uVoAAVmGctMOUZ7CZ1yYd2A@mail.gmail.com>
2013-12-19 18:43                         ` Ingo Molnar
2013-12-19 18:43                           ` Ingo Molnar
2013-12-19 20:09                         ` [tip:x86/idle] x86, idle: Use static_cpu_has() for CLFLUSH workaround, add barriers tip-bot for H. Peter Anvin
2013-12-19 20:40                           ` Ingo Molnar
2013-12-19 20:46                             ` Linus Torvalds
2013-12-19 21:14                               ` Ingo Molnar
2013-12-19 21:25                                 ` Linus Torvalds
2013-12-19 21:55                             ` Peter Zijlstra
2013-12-20  8:47                               ` Ingo Molnar
2013-12-19 20:33                         ` [tip:x86/idle] x86, idle: Add memory barriers around clflush in mwait_play_dead() tip-bot for H. Peter Anvin
2013-12-19 18:19                   ` [PATCH] x86 idle: repair large-server 50-watt idle-power regression Ingo Molnar
2013-12-19 19:22                     ` H. Peter Anvin
2013-12-19 19:27                       ` Peter Zijlstra
2013-12-19 19:51   ` [tip:x86/urgent] x86 idle: Repair " tip-bot for Len Brown
2014-03-18  0:20     ` Davidlohr Bueso
2014-03-18  9:16       ` Peter Zijlstra
2014-03-19  2:14         ` Jason Low
2014-03-19  6:42           ` Peter Zijlstra
2014-04-08 21:43       ` Brown, Len
2014-04-09  8:18         ` Peter Zijlstra
2014-04-15  3:27         ` Davidlohr Bueso

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=1386764955.12005.60.camel@marge.simpson.net \
    --to=bitbucket@online.de \
    --cc=bp@alien8.de \
    --cc=jeder@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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.