From: Shreyas B Prabhu <shreyas@linux.vnet.ibm.com>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
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 19:05:11 +0530 [thread overview]
Message-ID: <576BE58F.9030303@linux.vnet.ibm.com> (raw)
In-Reply-To: <576BB395.5050502@linaro.org>
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.
> Does it solve the issue if you replace >>10 by /1000 ?
>
Yes it does.
--Shreyas
next prev parent reply other threads:[~2016-06-23 13:35 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 [this message]
2016-06-23 14:36 ` Daniel Lezcano
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=576BE58F.9030303@linux.vnet.ibm.com \
--to=shreyas@linux.vnet.ibm.com \
--cc=anton@samba.org \
--cc=bsingharora@gmail.com \
--cc=daniel.lezcano@linaro.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=rjw@rjwysocki.net \
/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).