Subject: Re: [PATCH] cpuidle/powernv: Fix snooze timeout

From: Daniel Lezcano <[email-masked]>
Date: Thu, 23 Jun 2016 12:01:57 +0200

On 06/23/2016 11:28 AM, Balbir Singh wrote:

[ ... ]

>> cpuidle_enter_state()
>> {
>> 	[...]
>> 	time_start = local_clock();
>> 	[enter idle state]
>> 	time_end = local_clock();
>> 	/*
>>           * local_clock() returns the time in nanosecond, let's shift
>>           * by 10 (divide by 1024) to have microsecond based time.
>>           */
>>          diff = (time_end - time_start) >> 10;
>> 	[...]
>> 	dev->last_residency = (int) diff;
>> }
>>
>> Because of >>10 as opposed to /1000, last_residency is lesser by 2.3%

I am surprised the last_residency is 2.3% exactly less. The difference 
between >>10 and /1000 is 2.34%.

What is the next target residency value ?

Does it solve the issue if you replace >>10 by /1000 ?

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog