Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Paul E. McKenney
On Thu, Jul 20, 2017 at 04:19:40PM +0200, Peter Zijlstra wrote: > On Thu, Jul 20, 2017 at 05:50:54AM -0700, Paul E. McKenney wrote: > > > > > > static void cpuidle_idle_call() > > > { > > > rcu_idle_enter() > > > .. > > > rcu_idle_exit() > > > } > > > > > > I want > > > > > > static

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Paul E. McKenney
On Thu, Jul 20, 2017 at 04:19:40PM +0200, Peter Zijlstra wrote: > On Thu, Jul 20, 2017 at 05:50:54AM -0700, Paul E. McKenney wrote: > > > > > > static void cpuidle_idle_call() > > > { > > > rcu_idle_enter() > > > .. > > > rcu_idle_exit() > > > } > > > > > > I want > > > > > > static

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Peter Zijlstra
On Thu, Jul 20, 2017 at 05:50:54AM -0700, Paul E. McKenney wrote: > > > > static void cpuidle_idle_call() > > { > > rcu_idle_enter() > > .. > > rcu_idle_exit() > > } > > > > I want > > > > static void cpuidle_idle_call() > > { > > if (tick stopped) > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Peter Zijlstra
On Thu, Jul 20, 2017 at 05:50:54AM -0700, Paul E. McKenney wrote: > > > > static void cpuidle_idle_call() > > { > > rcu_idle_enter() > > .. > > rcu_idle_exit() > > } > > > > I want > > > > static void cpuidle_idle_call() > > { > > if (tick stopped) > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Arjan van de Ven
On 7/20/2017 1:11 AM, Thomas Gleixner wrote: On Thu, 20 Jul 2017, Li, Aubrey wrote: Don't get me wrong, even if a fast path is acceptable, we still need to figure out if the coming idle is short and when to switch. I'm just worried about if irq timings is not an ideal statistics, we have to

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Arjan van de Ven
On 7/20/2017 1:11 AM, Thomas Gleixner wrote: On Thu, 20 Jul 2017, Li, Aubrey wrote: Don't get me wrong, even if a fast path is acceptable, we still need to figure out if the coming idle is short and when to switch. I'm just worried about if irq timings is not an ideal statistics, we have to

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Arjan van de Ven
On 7/20/2017 5:50 AM, Paul E. McKenney wrote: To make this work reasonably, you would also need some way to check for the case where the prediction idle time is short but the real idle time is very long. so the case where you predict very short but is actually "indefinite", the real solution

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Arjan van de Ven
On 7/20/2017 5:50 AM, Paul E. McKenney wrote: To make this work reasonably, you would also need some way to check for the case where the prediction idle time is short but the real idle time is very long. so the case where you predict very short but is actually "indefinite", the real solution

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Paul E. McKenney
On Thu, Jul 20, 2017 at 09:40:49AM +0800, Li, Aubrey wrote: > On 2017/7/19 22:48, Paul E. McKenney wrote: > > On Wed, Jul 19, 2017 at 01:44:06PM +0800, Li, Aubrey wrote: > >> On 2017/7/18 23:20, Paul E. McKenney wrote: > >> > 2) for rcu idle enter/exit, I measured the details which Paul

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Paul E. McKenney
On Thu, Jul 20, 2017 at 09:40:49AM +0800, Li, Aubrey wrote: > On 2017/7/19 22:48, Paul E. McKenney wrote: > > On Wed, Jul 19, 2017 at 01:44:06PM +0800, Li, Aubrey wrote: > >> On 2017/7/18 23:20, Paul E. McKenney wrote: > >> > 2) for rcu idle enter/exit, I measured the details which Paul

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Thomas Gleixner
On Thu, 20 Jul 2017, Li, Aubrey wrote: > Don't get me wrong, even if a fast path is acceptable, we still need to > figure out if the coming idle is short and when to switch. I'm just worried > about if irq timings is not an ideal statistics, we have to skip it too. There is no ideal solution

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-20 Thread Thomas Gleixner
On Thu, 20 Jul 2017, Li, Aubrey wrote: > Don't get me wrong, even if a fast path is acceptable, we still need to > figure out if the coming idle is short and when to switch. I'm just worried > about if irq timings is not an ideal statistics, we have to skip it too. There is no ideal solution

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Li, Aubrey
On 2017/7/19 15:55, Thomas Gleixner wrote: > On Wed, 19 Jul 2017, Li, Aubrey wrote: >> On 2017/7/18 15:19, Thomas Gleixner wrote: >>> You can very well avoid it by taking the irq timings or whatever other >>> information into account for the NOHZ decision. >>> >> If I read the source correctly,

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Li, Aubrey
On 2017/7/19 15:55, Thomas Gleixner wrote: > On Wed, 19 Jul 2017, Li, Aubrey wrote: >> On 2017/7/18 15:19, Thomas Gleixner wrote: >>> You can very well avoid it by taking the irq timings or whatever other >>> information into account for the NOHZ decision. >>> >> If I read the source correctly,

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Li, Aubrey
On 2017/7/19 22:48, Paul E. McKenney wrote: > On Wed, Jul 19, 2017 at 01:44:06PM +0800, Li, Aubrey wrote: >> On 2017/7/18 23:20, Paul E. McKenney wrote: >> 2) for rcu idle enter/exit, I measured the details which Paul provided, and the result matches with what I have measured before,

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Li, Aubrey
On 2017/7/19 22:48, Paul E. McKenney wrote: > On Wed, Jul 19, 2017 at 01:44:06PM +0800, Li, Aubrey wrote: >> On 2017/7/18 23:20, Paul E. McKenney wrote: >> 2) for rcu idle enter/exit, I measured the details which Paul provided, and the result matches with what I have measured before,

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Paul E. McKenney
On Wed, Jul 19, 2017 at 10:03:22AM -0500, Christopher Lameter wrote: > On Wed, 19 Jul 2017, Paul E. McKenney wrote: > > > > Do we have any problem if we skip RCU idle enter/exit under a fast idle > > > scenario? > > > My understanding is, if tick is not stopped, then we don't need inform > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Paul E. McKenney
On Wed, Jul 19, 2017 at 10:03:22AM -0500, Christopher Lameter wrote: > On Wed, 19 Jul 2017, Paul E. McKenney wrote: > > > > Do we have any problem if we skip RCU idle enter/exit under a fast idle > > > scenario? > > > My understanding is, if tick is not stopped, then we don't need inform > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Christopher Lameter
On Wed, 19 Jul 2017, Paul E. McKenney wrote: > > Do we have any problem if we skip RCU idle enter/exit under a fast idle > > scenario? > > My understanding is, if tick is not stopped, then we don't need inform RCU > > in > > idle path, it can be informed in irq exit. > > Indeed, the problem

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Christopher Lameter
On Wed, 19 Jul 2017, Paul E. McKenney wrote: > > Do we have any problem if we skip RCU idle enter/exit under a fast idle > > scenario? > > My understanding is, if tick is not stopped, then we don't need inform RCU > > in > > idle path, it can be informed in irq exit. > > Indeed, the problem

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Paul E. McKenney
On Wed, Jul 19, 2017 at 03:43:07PM +0200, Frederic Weisbecker wrote: > On Wed, Jul 12, 2017 at 08:56:51AM -0700, Paul E. McKenney wrote: > > On Wed, Jul 12, 2017 at 01:54:51PM +0200, Peter Zijlstra wrote: > > > On Tue, Jul 11, 2017 at 11:09:31AM -0700, Paul E. McKenney wrote: > > > > On Tue, Jul

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Paul E. McKenney
On Wed, Jul 19, 2017 at 03:43:07PM +0200, Frederic Weisbecker wrote: > On Wed, Jul 12, 2017 at 08:56:51AM -0700, Paul E. McKenney wrote: > > On Wed, Jul 12, 2017 at 01:54:51PM +0200, Peter Zijlstra wrote: > > > On Tue, Jul 11, 2017 at 11:09:31AM -0700, Paul E. McKenney wrote: > > > > On Tue, Jul

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Paul E. McKenney
On Wed, Jul 19, 2017 at 01:44:06PM +0800, Li, Aubrey wrote: > On 2017/7/18 23:20, Paul E. McKenney wrote: > > >> 2) for rcu idle enter/exit, I measured the details which Paul provided, and > >> the result matches with what I have measured before, nothing notable found. > >> But it still makes

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Paul E. McKenney
On Wed, Jul 19, 2017 at 01:44:06PM +0800, Li, Aubrey wrote: > On 2017/7/18 23:20, Paul E. McKenney wrote: > > >> 2) for rcu idle enter/exit, I measured the details which Paul provided, and > >> the result matches with what I have measured before, nothing notable found. > >> But it still makes

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 11:14:57AM +0800, Li, Aubrey wrote: > On 2017/7/18 3:23, Peter Zijlstra wrote: > > On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: > >>> And as said; Daniel has been working on a better predictor -- now he's > >>> probably not used it on the network workload

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 11:14:57AM +0800, Li, Aubrey wrote: > On 2017/7/18 3:23, Peter Zijlstra wrote: > > On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: > >>> And as said; Daniel has been working on a better predictor -- now he's > >>> probably not used it on the network workload

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Frederic Weisbecker
On Wed, Jul 12, 2017 at 08:56:51AM -0700, Paul E. McKenney wrote: > On Wed, Jul 12, 2017 at 01:54:51PM +0200, Peter Zijlstra wrote: > > On Tue, Jul 11, 2017 at 11:09:31AM -0700, Paul E. McKenney wrote: > > > On Tue, Jul 11, 2017 at 06:34:22PM +0200, Peter Zijlstra wrote: > > > > > > But I think

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Frederic Weisbecker
On Wed, Jul 12, 2017 at 08:56:51AM -0700, Paul E. McKenney wrote: > On Wed, Jul 12, 2017 at 01:54:51PM +0200, Peter Zijlstra wrote: > > On Tue, Jul 11, 2017 at 11:09:31AM -0700, Paul E. McKenney wrote: > > > On Tue, Jul 11, 2017 at 06:34:22PM +0200, Peter Zijlstra wrote: > > > > > > But I think

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Thomas Gleixner
On Wed, 19 Jul 2017, Li, Aubrey wrote: > On 2017/7/18 15:19, Thomas Gleixner wrote: > > You can very well avoid it by taking the irq timings or whatever other > > information into account for the NOHZ decision. > > > If I read the source correctly, irq timing statistics computation happens at >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Thomas Gleixner
On Wed, 19 Jul 2017, Li, Aubrey wrote: > On 2017/7/18 15:19, Thomas Gleixner wrote: > > You can very well avoid it by taking the irq timings or whatever other > > information into account for the NOHZ decision. > > > If I read the source correctly, irq timing statistics computation happens at >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Li, Aubrey
On 2017/7/18 15:19, Thomas Gleixner wrote: > On Mon, 17 Jul 2017, Andi Kleen wrote: >> On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: >>> On Mon, 17 Jul 2017, Andi Kleen wrote: >>> > We need a tradeoff here IMHO. I'll check Daniel's work to understand > how/if > it's

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-19 Thread Li, Aubrey
On 2017/7/18 15:19, Thomas Gleixner wrote: > On Mon, 17 Jul 2017, Andi Kleen wrote: >> On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: >>> On Mon, 17 Jul 2017, Andi Kleen wrote: >>> > We need a tradeoff here IMHO. I'll check Daniel's work to understand > how/if > it's

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Li, Aubrey
On 2017/7/18 23:20, Paul E. McKenney wrote: >> 2) for rcu idle enter/exit, I measured the details which Paul provided, and >> the result matches with what I have measured before, nothing notable found. >> But it still makes more sense if we can make rcu idle enter/exit hooked with >> tick off.

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Li, Aubrey
On 2017/7/18 23:20, Paul E. McKenney wrote: >> 2) for rcu idle enter/exit, I measured the details which Paul provided, and >> the result matches with what I have measured before, nothing notable found. >> But it still makes more sense if we can make rcu idle enter/exit hooked with >> tick off.

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Mon, Jul 17, 2017 at 12:48:38PM -0700, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: > > Of course, this all assumes a Gaussian distribution to begin with, if we > > get bimodal (or worse) distributions we can still get it wrong. To fix > > that, we'd need to do

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Mon, Jul 17, 2017 at 12:48:38PM -0700, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: > > Of course, this all assumes a Gaussian distribution to begin with, if we > > get bimodal (or worse) distributions we can still get it wrong. To fix > > that, we'd need to do

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 09:37:57AM -0700, Arjan van de Ven wrote: > that's just a matter of fixing the C1 and later thresholds to line up right. > shrug that's the most trivial thing to do, it's a number in a table. Well, they represent a physical measure, namely the break-even-time. If you go

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 09:37:57AM -0700, Arjan van de Ven wrote: > that's just a matter of fixing the C1 and later thresholds to line up right. > shrug that's the most trivial thing to do, it's a number in a table. Well, they represent a physical measure, namely the break-even-time. If you go

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 02:56:47PM +0800, Li, Aubrey wrote: > 3) for tick nohz idle, we want to skip if the coming idle is short. If we can > skip the tick nohz idle, we then skip all the items depending on it. But, > there > are two hard points: > > 3.1) how to compute the period of the coming

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 02:56:47PM +0800, Li, Aubrey wrote: > 3) for tick nohz idle, we want to skip if the coming idle is short. If we can > skip the tick nohz idle, we then skip all the items depending on it. But, > there > are two hard points: > > 3.1) how to compute the period of the coming

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Arjan van de Ven
On 7/18/2017 9:36 AM, Peter Zijlstra wrote: On Tue, Jul 18, 2017 at 08:29:40AM -0700, Arjan van de Ven wrote: the most obvious way to do this (for me, maybe I'm naive) is to add another C state, lets call it "C1-lite" with its own thresholds and power levels etc, and just let that be picked

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Arjan van de Ven
On 7/18/2017 9:36 AM, Peter Zijlstra wrote: On Tue, Jul 18, 2017 at 08:29:40AM -0700, Arjan van de Ven wrote: the most obvious way to do this (for me, maybe I'm naive) is to add another C state, lets call it "C1-lite" with its own thresholds and power levels etc, and just let that be picked

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 08:29:40AM -0700, Arjan van de Ven wrote: > > the most obvious way to do this (for me, maybe I'm naive) is to add another > C state, lets call it "C1-lite" with its own thresholds and power levels etc, > and just let that be picked naturally based on the heuristics. > (if

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 08:29:40AM -0700, Arjan van de Ven wrote: > > the most obvious way to do this (for me, maybe I'm naive) is to add another > C state, lets call it "C1-lite" with its own thresholds and power levels etc, > and just let that be picked naturally based on the heuristics. > (if

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Arjan van de Ven
On 7/18/2017 8:20 AM, Paul E. McKenney wrote: 3.2) how to determine if the idle is short or long. My current proposal is to use a tunable value via /sys, while Peter prefers an auto-adjust mechanism. I didn't get the details of an auto-adjust mechanism yet the most obvious way to do this (for

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Arjan van de Ven
On 7/18/2017 8:20 AM, Paul E. McKenney wrote: 3.2) how to determine if the idle is short or long. My current proposal is to use a tunable value via /sys, while Peter prefers an auto-adjust mechanism. I didn't get the details of an auto-adjust mechanism yet the most obvious way to do this (for

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Paul E. McKenney
On Tue, Jul 18, 2017 at 02:56:47PM +0800, Li, Aubrey wrote: > On 2017/7/18 14:43, Thomas Gleixner wrote: > > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > >>> We need a tradeoff here IMHO. I'll check Daniel's work to understand > >>> how/if > >>> it's better than menu governor. > >> > >> I still

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Paul E. McKenney
On Tue, Jul 18, 2017 at 02:56:47PM +0800, Li, Aubrey wrote: > On 2017/7/18 14:43, Thomas Gleixner wrote: > > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > >>> We need a tradeoff here IMHO. I'll check Daniel's work to understand > >>> how/if > >>> it's better than menu governor. > >> > >> I still

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 11:14:57AM +0800, Li, Aubrey wrote: > On 2017/7/18 3:23, Peter Zijlstra wrote: > > On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: > >>> And as said; Daniel has been working on a better predictor -- now he's > >>> probably not used it on the network workload

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Peter Zijlstra
On Tue, Jul 18, 2017 at 11:14:57AM +0800, Li, Aubrey wrote: > On 2017/7/18 3:23, Peter Zijlstra wrote: > > On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: > >>> And as said; Daniel has been working on a better predictor -- now he's > >>> probably not used it on the network workload

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Andi Kleen wrote: > On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: > > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > > > > We need a tradeoff here IMHO. I'll check Daniel's work to understand > > > > how/if > > > > it's better than menu governor. > > > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Andi Kleen wrote: > On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: > > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > > > > We need a tradeoff here IMHO. I'll check Daniel's work to understand > > > > how/if > > > > it's better than menu governor. > > > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Andi Kleen wrote: > On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: > > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > > > > We need a tradeoff here IMHO. I'll check Daniel's work to understand > > > > how/if > > > > it's better than menu governor. > > > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Andi Kleen wrote: > On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: > > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > > > > We need a tradeoff here IMHO. I'll check Daniel's work to understand > > > > how/if > > > > it's better than menu governor. > > > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Andi Kleen
On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > > We need a tradeoff here IMHO. I'll check Daniel's work to understand > > > how/if > > > it's better than menu governor. > > > > I still would like to see how the fast path without

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Andi Kleen
On Tue, Jul 18, 2017 at 08:43:53AM +0200, Thomas Gleixner wrote: > On Mon, 17 Jul 2017, Andi Kleen wrote: > > > > We need a tradeoff here IMHO. I'll check Daniel's work to understand > > > how/if > > > it's better than menu governor. > > > > I still would like to see how the fast path without

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Li, Aubrey
On 2017/7/18 14:43, Thomas Gleixner wrote: > On Mon, 17 Jul 2017, Andi Kleen wrote: > >>> We need a tradeoff here IMHO. I'll check Daniel's work to understand how/if >>> it's better than menu governor. >> >> I still would like to see how the fast path without the C1 heuristic works. >> >> Fast

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Li, Aubrey
On 2017/7/18 14:43, Thomas Gleixner wrote: > On Mon, 17 Jul 2017, Andi Kleen wrote: > >>> We need a tradeoff here IMHO. I'll check Daniel's work to understand how/if >>> it's better than menu governor. >> >> I still would like to see how the fast path without the C1 heuristic works. >> >> Fast

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Andi Kleen wrote: > > We need a tradeoff here IMHO. I'll check Daniel's work to understand how/if > > it's better than menu governor. > > I still would like to see how the fast path without the C1 heuristic works. > > Fast pathing is a different concept from a better

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-18 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Andi Kleen wrote: > > We need a tradeoff here IMHO. I'll check Daniel's work to understand how/if > > it's better than menu governor. > > I still would like to see how the fast path without the C1 heuristic works. > > Fast pathing is a different concept from a better

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Andi Kleen
> We need a tradeoff here IMHO. I'll check Daniel's work to understand how/if > it's better than menu governor. I still would like to see how the fast path without the C1 heuristic works. Fast pathing is a different concept from a better predictor. IMHO we need both, but the first is likely

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Andi Kleen
> We need a tradeoff here IMHO. I'll check Daniel's work to understand how/if > it's better than menu governor. I still would like to see how the fast path without the C1 heuristic works. Fast pathing is a different concept from a better predictor. IMHO we need both, but the first is likely

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/18 3:48, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: >> Of course, this all assumes a Gaussian distribution to begin with, if we >> get bimodal (or worse) distributions we can still get it wrong. To fix >> that, we'd need to do something better than what we

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/18 3:48, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: >> Of course, this all assumes a Gaussian distribution to begin with, if we >> get bimodal (or worse) distributions we can still get it wrong. To fix >> that, we'd need to do something better than what we

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/18 3:23, Peter Zijlstra wrote: > On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: >>> And as said; Daniel has been working on a better predictor -- now he's >>> probably not used it on the network workload you're looking at, so that >>> might be something to consider. >> >>

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/18 3:23, Peter Zijlstra wrote: > On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: >>> And as said; Daniel has been working on a better predictor -- now he's >>> probably not used it on the network workload you're looking at, so that >>> might be something to consider. >> >>

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Arjan van de Ven wrote: > On 7/17/2017 12:46 PM, Thomas Gleixner wrote: > > That's where Daniel Lezcanos work of predicting interrupts comes in and > > that's the right solution to the problem. The core infrastructure has been > > merged, just the idle/cpufreq users are not

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Arjan van de Ven wrote: > On 7/17/2017 12:46 PM, Thomas Gleixner wrote: > > That's where Daniel Lezcanos work of predicting interrupts comes in and > > that's the right solution to the problem. The core infrastructure has been > > merged, just the idle/cpufreq users are not

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:53 PM, Thomas Gleixner wrote: On Mon, 17 Jul 2017, Arjan van de Ven wrote: On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Of course, this all assumes a Gaussian distribution to begin with, if we get bimodal (or worse) distributions we can still get it wrong. To fix that, we'd

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:53 PM, Thomas Gleixner wrote: On Mon, 17 Jul 2017, Arjan van de Ven wrote: On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Of course, this all assumes a Gaussian distribution to begin with, if we get bimodal (or worse) distributions we can still get it wrong. To fix that, we'd

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: > > Of course, this all assumes a Gaussian distribution to begin with, if we > > get bimodal (or worse) distributions we can still get it wrong. To fix > > that, we'd need to do something better than what

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: > > Of course, this all assumes a Gaussian distribution to begin with, if we > > get bimodal (or worse) distributions we can still get it wrong. To fix > > that, we'd need to do something better than what

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:46 PM, Thomas Gleixner wrote: On Mon, 17 Jul 2017, Arjan van de Ven wrote: On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Now I think the problem is that the current predictor goes for an average idle duration. This means that we, on average, get it wrong 50% of the time. For

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:46 PM, Thomas Gleixner wrote: On Mon, 17 Jul 2017, Arjan van de Ven wrote: On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Now I think the problem is that the current predictor goes for an average idle duration. This means that we, on average, get it wrong 50% of the time. For

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Of course, this all assumes a Gaussian distribution to begin with, if we get bimodal (or worse) distributions we can still get it wrong. To fix that, we'd need to do something better than what we currently have. fwiw some time ago I made a chart

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Of course, this all assumes a Gaussian distribution to begin with, if we get bimodal (or worse) distributions we can still get it wrong. To fix that, we'd need to do something better than what we currently have. fwiw some time ago I made a chart

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: > > Now I think the problem is that the current predictor goes for an > > average idle duration. This means that we, on average, get it wrong 50% > > of the time. For performance that's bad. > > that's not

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Thomas Gleixner
On Mon, 17 Jul 2017, Arjan van de Ven wrote: > On 7/17/2017 12:23 PM, Peter Zijlstra wrote: > > Now I think the problem is that the current predictor goes for an > > average idle duration. This means that we, on average, get it wrong 50% > > of the time. For performance that's bad. > > that's not

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Now I think the problem is that the current predictor goes for an average idle duration. This means that we, on average, get it wrong 50% of the time. For performance that's bad. that's not really what it does; it looks at next tick and then

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Arjan van de Ven
On 7/17/2017 12:23 PM, Peter Zijlstra wrote: Now I think the problem is that the current predictor goes for an average idle duration. This means that we, on average, get it wrong 50% of the time. For performance that's bad. that's not really what it does; it looks at next tick and then

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: > > And as said; Daniel has been working on a better predictor -- now he's > > probably not used it on the network workload you're looking at, so that > > might be something to consider. > > Deriving a better idle predictor is a bit

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 09:26:19AM -0700, Andi Kleen wrote: > > And as said; Daniel has been working on a better predictor -- now he's > > probably not used it on the network workload you're looking at, so that > > might be something to consider. > > Deriving a better idle predictor is a bit

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/17 21:58, Peter Zijlstra wrote: > On Mon, Jul 17, 2017 at 09:24:51PM +0800, Li, Aubrey wrote: >> On 2017/7/14 12:05, Paul E. McKenney wrote: >>> >>> More specifically: rcu_needs_cpu(), rcu_prepare_for_idle(), >>> rcu_cleanup_after_idle(), rcu_eqs_enter(), rcu_eqs_enter_common(), >>>

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/17 21:58, Peter Zijlstra wrote: > On Mon, Jul 17, 2017 at 09:24:51PM +0800, Li, Aubrey wrote: >> On 2017/7/14 12:05, Paul E. McKenney wrote: >>> >>> More specifically: rcu_needs_cpu(), rcu_prepare_for_idle(), >>> rcu_cleanup_after_idle(), rcu_eqs_enter(), rcu_eqs_enter_common(), >>>

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Peter Zijlstra
On Mon, Jul 17, 2017 at 09:24:51PM +0800, Li, Aubrey wrote: > On 2017/7/14 12:05, Paul E. McKenney wrote: > > > > More specifically: rcu_needs_cpu(), rcu_prepare_for_idle(), > > rcu_cleanup_after_idle(), rcu_eqs_enter(), rcu_eqs_enter_common(), > > rcu_dynticks_eqs_enter(),

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Peter Zijlstra
On Mon, Jul 17, 2017 at 09:24:51PM +0800, Li, Aubrey wrote: > On 2017/7/14 12:05, Paul E. McKenney wrote: > > > > More specifically: rcu_needs_cpu(), rcu_prepare_for_idle(), > > rcu_cleanup_after_idle(), rcu_eqs_enter(), rcu_eqs_enter_common(), > > rcu_dynticks_eqs_enter(),

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/17 17:21, Peter Zijlstra wrote: > On Fri, Jul 14, 2017 at 09:03:14AM -0700, Andi Kleen wrote: >> fast idle doesn't have an upper bound. >> >> If the prediction exceeds the fast idle threshold any C state can be used. >> >> It's just another state (fast C1), but right now it has an own

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/17 17:21, Peter Zijlstra wrote: > On Fri, Jul 14, 2017 at 09:03:14AM -0700, Andi Kleen wrote: >> fast idle doesn't have an upper bound. >> >> If the prediction exceeds the fast idle threshold any C state can be used. >> >> It's just another state (fast C1), but right now it has an own

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/14 12:05, Paul E. McKenney wrote: > > More specifically: rcu_needs_cpu(), rcu_prepare_for_idle(), > rcu_cleanup_after_idle(), rcu_eqs_enter(), rcu_eqs_enter_common(), > rcu_dynticks_eqs_enter(), do_nocb_deferred_wakeup(), > rcu_dynticks_task_enter(), rcu_eqs_exit(),

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Li, Aubrey
On 2017/7/14 12:05, Paul E. McKenney wrote: > > More specifically: rcu_needs_cpu(), rcu_prepare_for_idle(), > rcu_cleanup_after_idle(), rcu_eqs_enter(), rcu_eqs_enter_common(), > rcu_dynticks_eqs_enter(), do_nocb_deferred_wakeup(), > rcu_dynticks_task_enter(), rcu_eqs_exit(),

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 09:03:14AM -0700, Andi Kleen wrote: > fast idle doesn't have an upper bound. > > If the prediction exceeds the fast idle threshold any C state can be used. > > It's just another state (fast C1), but right now it has an own threshold > which may be different from standard

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-17 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 09:03:14AM -0700, Andi Kleen wrote: > fast idle doesn't have an upper bound. > > If the prediction exceeds the fast idle threshold any C state can be used. > > It's just another state (fast C1), but right now it has an own threshold > which may be different from standard

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Andi Kleen
> And as said; Daniel has been working on a better predictor -- now he's > probably not used it on the network workload you're looking at, so that > might be something to consider. Deriving a better idle predictor is a bit orthogonal to fast idle. It would be a good idea to set the fast idle

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Andi Kleen
> And as said; Daniel has been working on a better predictor -- now he's > probably not used it on the network workload you're looking at, so that > might be something to consider. Deriving a better idle predictor is a bit orthogonal to fast idle. It would be a good idea to set the fast idle

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 08:53:56AM -0700, Andi Kleen wrote: > > > - if (cpuidle_not_available(drv, dev)) { > > > + if (cpuidle_not_available(drv, dev) || this_is_a_fast_idle) { > > > default_idle_call(); > > > goto exit_idle; > > > } > > > > No, that's wrong. We want to fix

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 08:53:56AM -0700, Andi Kleen wrote: > > > - if (cpuidle_not_available(drv, dev)) { > > > + if (cpuidle_not_available(drv, dev) || this_is_a_fast_idle) { > > > default_idle_call(); > > > goto exit_idle; > > > } > > > > No, that's wrong. We want to fix

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Andi Kleen
On Fri, Jul 14, 2017 at 05:58:53PM +0200, Peter Zijlstra wrote: > On Fri, Jul 14, 2017 at 08:52:28AM -0700, Arjan van de Ven wrote: > > On 7/14/2017 8:38 AM, Peter Zijlstra wrote: > > > No, that's wrong. We want to fix the normal C state selection process to > > > pick the right C state. > > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Andi Kleen
On Fri, Jul 14, 2017 at 05:58:53PM +0200, Peter Zijlstra wrote: > On Fri, Jul 14, 2017 at 08:52:28AM -0700, Arjan van de Ven wrote: > > On 7/14/2017 8:38 AM, Peter Zijlstra wrote: > > > No, that's wrong. We want to fix the normal C state selection process to > > > pick the right C state. > > > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 08:52:28AM -0700, Arjan van de Ven wrote: > On 7/14/2017 8:38 AM, Peter Zijlstra wrote: > > No, that's wrong. We want to fix the normal C state selection process to > > pick the right C state. > > > > The fast-idle criteria could cut off a whole bunch of available C > >

Re: [RFC PATCH v1 00/11] Create fast idle path for short idle periods

2017-07-14 Thread Peter Zijlstra
On Fri, Jul 14, 2017 at 08:52:28AM -0700, Arjan van de Ven wrote: > On 7/14/2017 8:38 AM, Peter Zijlstra wrote: > > No, that's wrong. We want to fix the normal C state selection process to > > pick the right C state. > > > > The fast-idle criteria could cut off a whole bunch of available C > >

  1   2   >