Re: [PATCH v3] cpuidle: Fix last_residency division

2016-06-30 Thread Shreyas B Prabhu
On 06/29/2016 08:31 PM, Nicolas Pitre wrote: > On Wed, 29 Jun 2016, Daniel Lezcano wrote: > >> On 06/29/2016 09:06 AM, Shreyas B. Prabhu wrote: >>> diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h >>> index f87f399..c8ea5ad 100644 >>> --- a/drivers/cpuidle/cpuidle.h >>> +++

Re: [PATCH v3] cpuidle: Fix last_residency division

2016-06-29 Thread Nicolas Pitre
On Wed, 29 Jun 2016, Nicolas Pitre wrote: > On Wed, 29 Jun 2016, Daniel Lezcano wrote: > > > On 06/29/2016 09:06 AM, Shreyas B. Prabhu wrote: > > > diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h > > > index f87f399..c8ea5ad 100644 > > > --- a/drivers/cpuidle/cpuidle.h > > >

Re: [PATCH v3] cpuidle: Fix last_residency division

2016-06-29 Thread Nicolas Pitre
On Wed, 29 Jun 2016, Daniel Lezcano wrote: > On 06/29/2016 09:06 AM, Shreyas B. Prabhu wrote: > > diff --git a/drivers/cpuidle/cpuidle.h b/drivers/cpuidle/cpuidle.h > > index f87f399..c8ea5ad 100644 > > --- a/drivers/cpuidle/cpuidle.h > > +++ b/drivers/cpuidle/cpuidle.h > > @@ -68,4 +68,27 @@

Re: [PATCH v3] cpuidle: Fix last_residency division

2016-06-29 Thread Shreyas B Prabhu
>> >> +/* >> + * Used for calculating last_residency in usec. Optimized for case >> + * where last_residency in nsecs is < INT_MAX/2 by using faster >> + * approximation. Approximated value has less than 1% error. >> + */ >> +static inline int convert_nsec_to_usec(u64 nsec) >> +{ >> +if

Re: [PATCH v3] cpuidle: Fix last_residency division

2016-06-29 Thread Daniel Lezcano
On 06/29/2016 09:06 AM, 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 v3] cpuidle: Fix last_residency division

2016-06-29 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