Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Arjan van de Ven
On 11/20/2013 8:33 AM, Peter Zijlstra wrote: On Wed, Nov 20, 2013 at 08:24:47AM -0800, Arjan van de Ven wrote: On 11/20/2013 2:58 AM, Peter Zijlstra wrote: So pretty silly actually; you cannot do a store (any store) in between monitor and mwait. you can just not to the cacheline you are

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Peter Zijlstra
On Wed, Nov 20, 2013 at 08:24:47AM -0800, Arjan van de Ven wrote: > On 11/20/2013 2:58 AM, Peter Zijlstra wrote: > >So pretty silly actually; you cannot do a store (any store) in between > >monitor and mwait. > > you can > just not to the cacheline you are watching (or things that alias with

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Arjan van de Ven
On 11/20/2013 2:58 AM, Peter Zijlstra wrote: On Wed, Nov 20, 2013 at 11:28:03AM +0100, Peter Zijlstra wrote: On Tue, Nov 19, 2013 at 01:06:30PM -0800, Jacob Pan wrote: I applied this patch on top of upstream kernel (801a760) and found out my machine completely failed to enter idle when nothing

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Peter Zijlstra
On Wed, Nov 20, 2013 at 11:28:03AM +0100, Peter Zijlstra wrote: > On Tue, Nov 19, 2013 at 01:06:30PM -0800, Jacob Pan wrote: > > I applied this patch on top of upstream kernel (801a760) and found out > > my machine completely failed to enter idle when nothing is running. > > turbostate shows 100%

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 01:06:30PM -0800, Jacob Pan wrote: > On Tue, 19 Nov 2013 16:13:38 +0100 > Peter Zijlstra wrote: > > > On Tue, Nov 19, 2013 at 03:51:43PM +0100, Peter Zijlstra wrote: > > > That said, that drive is completely wrecked. It uses > > > preempt_enable_no_resched() wrong too, it

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 01:06:30PM -0800, Jacob Pan wrote: On Tue, 19 Nov 2013 16:13:38 +0100 Peter Zijlstra pet...@infradead.org wrote: On Tue, Nov 19, 2013 at 03:51:43PM +0100, Peter Zijlstra wrote: That said, that drive is completely wrecked. It uses preempt_enable_no_resched()

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Peter Zijlstra
On Wed, Nov 20, 2013 at 11:28:03AM +0100, Peter Zijlstra wrote: On Tue, Nov 19, 2013 at 01:06:30PM -0800, Jacob Pan wrote: I applied this patch on top of upstream kernel (801a760) and found out my machine completely failed to enter idle when nothing is running. turbostate shows 100% C0.

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Arjan van de Ven
On 11/20/2013 2:58 AM, Peter Zijlstra wrote: On Wed, Nov 20, 2013 at 11:28:03AM +0100, Peter Zijlstra wrote: On Tue, Nov 19, 2013 at 01:06:30PM -0800, Jacob Pan wrote: I applied this patch on top of upstream kernel (801a760) and found out my machine completely failed to enter idle when nothing

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Peter Zijlstra
On Wed, Nov 20, 2013 at 08:24:47AM -0800, Arjan van de Ven wrote: On 11/20/2013 2:58 AM, Peter Zijlstra wrote: So pretty silly actually; you cannot do a store (any store) in between monitor and mwait. you can just not to the cacheline you are watching (or things that alias with that) Ah

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-20 Thread Arjan van de Ven
On 11/20/2013 8:33 AM, Peter Zijlstra wrote: On Wed, Nov 20, 2013 at 08:24:47AM -0800, Arjan van de Ven wrote: On 11/20/2013 2:58 AM, Peter Zijlstra wrote: So pretty silly actually; you cannot do a store (any store) in between monitor and mwait. you can just not to the cacheline you are

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Jacob Pan
On Tue, 19 Nov 2013 16:13:38 +0100 Peter Zijlstra wrote: > On Tue, Nov 19, 2013 at 03:51:43PM +0100, Peter Zijlstra wrote: > > That said, that drive is completely wrecked. It uses > > preempt_enable_no_resched() wrong too, it has uncommented barriers.. > > > > Dude, wtf are you guys smoking? >

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 03:51:43PM +0100, Peter Zijlstra wrote: > That said, that drive is completely wrecked. It uses > preempt_enable_no_resched() wrong too, it has uncommented barriers.. > > Dude, wtf are you guys smoking? --- Subject: sched: Take away preempt_enable_no_resched() and friends

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 06:22:43AM -0800, Arjan van de Ven wrote: > >diff --git a/drivers/thermal/intel_powerclamp.c > >b/drivers/thermal/intel_powerclamp.c > >index 8f181b3f842b..e8275f2df9af 100644 > >--- a/drivers/thermal/intel_powerclamp.c > >+++ b/drivers/thermal/intel_powerclamp.c > >@@

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 06:22:43AM -0800, Arjan van de Ven wrote: > >diff --git a/drivers/thermal/intel_powerclamp.c > >b/drivers/thermal/intel_powerclamp.c > >index 8f181b3f842b..e8275f2df9af 100644 > >--- a/drivers/thermal/intel_powerclamp.c > >+++ b/drivers/thermal/intel_powerclamp.c > >@@

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Arjan van de Ven
diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c index 8f181b3f842b..e8275f2df9af 100644 --- a/drivers/thermal/intel_powerclamp.c +++ b/drivers/thermal/intel_powerclamp.c @@ -438,9 +438,7 @@ static int clamp_thread(void *arg) */

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Mike Galbraith
On Tue, 2013-11-19 at 12:31 +0100, Peter Zijlstra wrote: > People seem to delight in writing wrong and broken mwait idle routines; > collapse the lot. > > This leaves mwait_play_dead() the sole remaining user of __mwait() and > new __mwait() users are probably doing it wrong. > > Also remove

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Rafael J. Wysocki
On Tuesday, November 19, 2013 12:31:53 PM Peter Zijlstra wrote: > People seem to delight in writing wrong and broken mwait idle routines; > collapse the lot. > > This leaves mwait_play_dead() the sole remaining user of __mwait() and > new __mwait() users are probably doing it wrong. > > Also

[PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
People seem to delight in writing wrong and broken mwait idle routines; collapse the lot. This leaves mwait_play_dead() the sole remaining user of __mwait() and new __mwait() users are probably doing it wrong. Also remove __sti_mwait() as its unused. Signed-off-by: Peter Zijlstra --- Mike,

[PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
People seem to delight in writing wrong and broken mwait idle routines; collapse the lot. This leaves mwait_play_dead() the sole remaining user of __mwait() and new __mwait() users are probably doing it wrong. Also remove __sti_mwait() as its unused. Signed-off-by: Peter Zijlstra

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Rafael J. Wysocki
On Tuesday, November 19, 2013 12:31:53 PM Peter Zijlstra wrote: People seem to delight in writing wrong and broken mwait idle routines; collapse the lot. This leaves mwait_play_dead() the sole remaining user of __mwait() and new __mwait() users are probably doing it wrong. Also remove

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Mike Galbraith
On Tue, 2013-11-19 at 12:31 +0100, Peter Zijlstra wrote: People seem to delight in writing wrong and broken mwait idle routines; collapse the lot. This leaves mwait_play_dead() the sole remaining user of __mwait() and new __mwait() users are probably doing it wrong. Also remove

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Arjan van de Ven
diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c index 8f181b3f842b..e8275f2df9af 100644 --- a/drivers/thermal/intel_powerclamp.c +++ b/drivers/thermal/intel_powerclamp.c @@ -438,9 +438,7 @@ static int clamp_thread(void *arg) */

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 06:22:43AM -0800, Arjan van de Ven wrote: diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c index 8f181b3f842b..e8275f2df9af 100644 --- a/drivers/thermal/intel_powerclamp.c +++ b/drivers/thermal/intel_powerclamp.c @@ -438,9 +438,7

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 06:22:43AM -0800, Arjan van de Ven wrote: diff --git a/drivers/thermal/intel_powerclamp.c b/drivers/thermal/intel_powerclamp.c index 8f181b3f842b..e8275f2df9af 100644 --- a/drivers/thermal/intel_powerclamp.c +++ b/drivers/thermal/intel_powerclamp.c @@ -438,9 +438,7

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Peter Zijlstra
On Tue, Nov 19, 2013 at 03:51:43PM +0100, Peter Zijlstra wrote: That said, that drive is completely wrecked. It uses preempt_enable_no_resched() wrong too, it has uncommented barriers.. Dude, wtf are you guys smoking? --- Subject: sched: Take away preempt_enable_no_resched() and friends from

Re: [PATCH] x86, acpi, idle: Restructure the mwait idle routines

2013-11-19 Thread Jacob Pan
On Tue, 19 Nov 2013 16:13:38 +0100 Peter Zijlstra pet...@infradead.org wrote: On Tue, Nov 19, 2013 at 03:51:43PM +0100, Peter Zijlstra wrote: That said, that drive is completely wrecked. It uses preempt_enable_no_resched() wrong too, it has uncommented barriers.. Dude, wtf are you guys