linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Shreyas B Prabhu <shreyas@linux.vnet.ibm.com>,
	Balbir Singh <bsingharora@gmail.com>,
	rjw@rjwysocki.net
Cc: linux-pm@vger.kernel.org, anton@samba.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] cpuidle/powernv: Fix snooze timeout
Date: Thu, 23 Jun 2016 16:36:01 +0200	[thread overview]
Message-ID: <576BF3D1.6030507@linaro.org> (raw)
In-Reply-To: <576BE58F.9030303@linux.vnet.ibm.com>

On 06/23/2016 03:35 PM, Shreyas B Prabhu wrote:
>
>
> On 06/23/2016 03:31 PM, Daniel Lezcano wrote:
>> 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 ?
>>
> Target residency of the next idle state is 100 microseconds.
> When snooze times out after 100 microseconds, last_residency value
> calculated is typically 97 or 98 microseconds.

I see, the snooze exit is very fast.

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

Ok. IMO, it would be cleaner to fix this in the core code.

   -- Daniel

-- 
  <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

      reply	other threads:[~2016-06-23 14:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 19:36 [PATCH] cpuidle/powernv: Fix snooze timeout Shreyas B. Prabhu
2016-06-22 22:49 ` Rafael J. Wysocki
2016-06-22 23:48 ` Balbir Singh
2016-06-23  4:58   ` Shreyas B Prabhu
2016-06-23  9:28     ` Balbir Singh
2016-06-23  9:41       ` Shreyas B Prabhu
2016-06-23  9:55         ` Balbir Singh
2016-06-23 10:01       ` Daniel Lezcano
2016-06-23 13:35         ` Shreyas B Prabhu
2016-06-23 14:36           ` Daniel Lezcano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=576BF3D1.6030507@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=anton@samba.org \
    --cc=bsingharora@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=rjw@rjwysocki.net \
    --cc=shreyas@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).