Re: [PATCH v4] cpuidle: Fix last_residency division

2016-07-01 Thread Shreyas B Prabhu
On 07/01/2016 01:36 PM, Daniel Lezcano wrote: > On 06/30/2016 05:37 PM, Nicolas Pitre wrote: >> On Thu, 30 Jun 2016, Daniel Lezcano wrote: >>> +} +} >>> >>> >>> What bothers me with this division is the benefit of adding an extra >>> ultra >>> optimized division by 1000 in cpuidle.h

Re: [PATCH v4] cpuidle: Fix last_residency division

2016-07-01 Thread Nicolas Pitre
On Fri, 1 Jul 2016, Balbir Singh wrote: > On Fri, 2016-07-01 at 10:06 +0200, Daniel Lezcano wrote: > > On 06/30/2016 05:37 PM, Nicolas Pitre wrote: > > >  > > > On Thu, 30 Jun 2016, Daniel Lezcano wrote: > > [ ... ] > >  > > >  > > > >  > > > > >  > > > > > + if (likely(nsec <

Re: [PATCH v4] cpuidle: Fix last_residency division

2016-07-01 Thread Nicolas Pitre
On Fri, 1 Jul 2016, Daniel Lezcano wrote: > On 06/30/2016 05:37 PM, Nicolas Pitre wrote: > > On Thu, 30 Jun 2016, Daniel Lezcano wrote: > > [ ... ] > > > > > + if (likely(nsec < DIV_APPROXIMATION_THRESHOLD)) { > > > > + u32 usec = nsec; > > > > + > > > > + usec

Re: [PATCH v4] cpuidle: Fix last_residency division

2016-07-01 Thread Balbir Singh
On Fri, 2016-07-01 at 10:06 +0200, Daniel Lezcano wrote: > On 06/30/2016 05:37 PM, Nicolas Pitre wrote: > >  > > On Thu, 30 Jun 2016, Daniel Lezcano wrote: > [ ... ] >  > >  > > >  > > > >  > > > > + if (likely(nsec < DIV_APPROXIMATION_THRESHOLD)) { > > > > + u32 usec = nsec; >

Re: [PATCH v4] cpuidle: Fix last_residency division

2016-07-01 Thread Daniel Lezcano
On 06/30/2016 05:37 PM, Nicolas Pitre wrote: On Thu, 30 Jun 2016, Daniel Lezcano wrote: [ ... ] + if (likely(nsec < DIV_APPROXIMATION_THRESHOLD)) { + u32 usec = nsec; + + usec += usec >> 5; + usec = usec >> 10; + + /* Can safely

Re: [PATCH v4] cpuidle: Fix last_residency division

2016-06-30 Thread Nicolas Pitre
On Thu, 30 Jun 2016, Daniel Lezcano wrote: > On 06/30/2016 04:34 PM, Shreyas B. Prabhu wrote: > > Snooze is a poll idle state in powernv and pseries platforms. Snooze > > has a timeout so that if a cpu stays in snooze for more than target > > residency of the next available idle state, then it

Re: [PATCH v4] cpuidle: Fix last_residency division

2016-06-30 Thread Daniel Lezcano
On 06/30/2016 04:34 PM, Shreyas B. Prabhu wrote: Snooze is a poll idle state in powernv and pseries platforms. Snooze has a timeout so that if a cpu stays in snooze for more than target residency of the next available idle state, then it would exit thereby giving chance to the cpuidle governor

[PATCH v4] cpuidle: Fix last_residency division

2016-06-30 Thread Shreyas B. Prabhu
Snooze is a poll idle state in powernv and pseries platforms. Snooze has a timeout so that if a cpu stays in snooze for more than target residency of the next available idle state, then it would exit thereby giving chance to the cpuidle governor to re-evaluate and promote the cpu to a deeper idle