Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-29 Thread Shreyas B Prabhu
On 06/27/2016 02:29 PM, David Laight wrote: > From: Arnd Bergmann >> Sent: 24 June 2016 20:43 >> On Friday, June 24, 2016 9:31:35 PM CEST Shreyas B Prabhu wrote: If those functions are called less often than cpuidle_enter_state(), we could just move the division there. Since the

RE: [PATCH v2] cpuidle: Fix last_residency division

2016-06-27 Thread David Laight
From: Arnd Bergmann > Sent: 24 June 2016 20:43 > On Friday, June 24, 2016 9:31:35 PM CEST Shreyas B Prabhu wrote: > > > If those functions are called less often than cpuidle_enter_state(), > > > we could just move the division there. Since the divisor is constant, > > > do_div() can convert it

Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread Arnd Bergmann
On Friday, June 24, 2016 9:31:35 PM CEST Shreyas B Prabhu wrote: > > If those functions are called less often than cpuidle_enter_state(), > > we could just move the division there. Since the divisor is constant, > > do_div() can convert it into a multiply and shift, or we could use > > your the

Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread Shreyas B Prabhu
On 06/24/2016 03:41 PM, Arnd Bergmann wrote: > On Friday, June 24, 2016 9:00:48 AM CEST David Laight wrote: >> The intent of the >> 10 was probably to avoid an expensive 64bit divide. >> So maybe something like: >> diff = time_end - time_start; >> if (diff >= INT_MAX/2) >>

Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread kbuild test robot
Hi, [auto build test ERROR on pm/linux-next] [also build test ERROR on v4.7-rc4 next-20160623] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread kbuild test robot
Hi, [auto build test ERROR on pm/linux-next] [also build test ERROR on v4.7-rc4 next-20160624] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread Arnd Bergmann
On Friday, June 24, 2016 9:00:48 AM CEST David Laight wrote: > The intent of the >> 10 was probably to avoid an expensive 64bit divide. > So maybe something like: > diff = time_end - time_start; > if (diff >= INT_MAX/2) > diff_32 = INT_MAX/2/1000; > else >

Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread Daniel Lezcano
On 06/24/2016 11:00 AM, David Laight wrote: From: Shreyas B. Prabhu Sent: 24 June 2016 09:24 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

Re: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread kbuild test robot
Hi, [auto build test ERROR on pm/linux-next] [also build test ERROR on v4.7-rc4 next-20160624] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url:

RE: [PATCH v2] cpuidle: Fix last_residency division

2016-06-24 Thread David Laight
From: Shreyas B. Prabhu > Sent: 24 June 2016 09:24 > > 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