From: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 7/7] Cpuidle: poll state can measure residency
Date: Tue, 25 Feb 2014 17:40:08 +0200 [thread overview]
Message-ID: <CAG-99FNrtBf77Kx4z3fhmpMnttnoowpqMiWFUTTMmdroBr4FYw@mail.gmail.com> (raw)
In-Reply-To: <530C76E7.8090607@linaro.org>
On 25 February 2014 12:56, Daniel Lezcano <daniel.lezcano@linaro.org> wrote:
> On 02/24/2014 07:29 AM, Tuukka Tikkanen wrote:
>>
>> For some platforms, a poll state is inserted in the cpuidle driver states.
>> The flags for the state do not indicate that timekeeping is not affected.
>> As the state does not do anything apart from calling cpu_relax(), the
>> times returned by ktime_get should remain valid. Add the missing flag.
>
>
> Yes, but it is done with the interrupt enabled, so the interrupt handler +
> softirq handler times will be accounted in the residency time.
>
> I am not sure adding this flag is good.
Granted, with a slow CPU and very complex interrupt handing there
might be some extra time added. So let's consider what might happen:
Menu: Not having this flag assumes the residency matches time until
next timer expiry. Any measured amount of time less than that
indicates that the residency was shorter. We might not know exactly
how much, but we are closer to the truth and everything is fine. So
that leaves reporting time that exceeds what was established as the
time until next timer expiry. That too is OK (assuming another patch
in the series) as the value is limited to the time until next timer
expiry. In short, we get the same or better outcome and have no
issues.
Ladder: Last residency is assumed to be
last_state->threshold.promotion_time + 1 if the flag is not set.
Obviously we won't be considering demotion in that case and will go
into the promotion path. Any measured value below that is again closer
to the truth and any value at or above that is simply going to result
in the same outcome.
The only remaining issue is any hypothetical governor not currently in
the kernel tree. It would have to depend on accurate measurements
while being able to work with states that do not have the valid time
flag. I'm not sure if I can picture a scenario like that.
Tuukka
>
>> Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
>> ---
>> drivers/cpuidle/driver.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/cpuidle/driver.c b/drivers/cpuidle/driver.c
>> index 06dbe7c..136d6a2 100644
>> --- a/drivers/cpuidle/driver.c
>> +++ b/drivers/cpuidle/driver.c
>> @@ -209,7 +209,7 @@ static void poll_idle_init(struct cpuidle_driver *drv)
>> state->exit_latency = 0;
>> state->target_residency = 0;
>> state->power_usage = -1;
>> - state->flags = 0;
>> + state->flags = CPUIDLE_FLAG_TIME_VALID;
>> state->enter = poll_idle;
>> state->disabled = false;
>> }
>>
>
>
> --
> <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
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-02-25 15:40 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 6:29 [PATCH 0/7] Cpuidle: Minor fixes Tuukka Tikkanen
2014-02-24 6:29 ` [PATCH 1/7] Cpuidle: rename expected_us to next_timer_us in menu governor Tuukka Tikkanen
2014-02-24 16:52 ` Nicolas Pitre
2014-03-05 22:26 ` Len Brown
2014-02-24 6:29 ` [PATCH 2/7] Cpuidle: Use actual state latency " Tuukka Tikkanen
2014-02-24 22:35 ` Daniel Lezcano
2014-02-24 6:29 ` [PATCH 3/7] Cpuidle: Ensure menu coefficients stay within domain Tuukka Tikkanen
2014-02-24 16:57 ` Nicolas Pitre
2014-02-24 6:29 ` [PATCH 4/7] Cpuidle: Do not substract exit latency from assumed sleep length Tuukka Tikkanen
2014-02-24 6:29 ` [PATCH 5/7] Cpuidle: Move perf multiplier calculation out of the selection loop Tuukka Tikkanen
2014-02-24 6:29 ` [PATCH 6/7] Cpuidle: Deal with timer expiring in the past Tuukka Tikkanen
2014-02-24 17:05 ` Nicolas Pitre
2014-02-25 0:20 ` Rafael J. Wysocki
2014-03-06 7:41 ` Len Brown
2014-03-07 3:09 ` Len Brown
2014-03-10 10:54 ` Tuukka Tikkanen
2014-03-21 23:10 ` Len Brown
2014-02-24 6:29 ` [PATCH 7/7] Cpuidle: poll state can measure residency Tuukka Tikkanen
2014-02-25 10:56 ` Daniel Lezcano
2014-02-25 15:40 ` Tuukka Tikkanen [this message]
2014-02-24 21:24 ` [PATCH 0/7] Cpuidle: Minor fixes Daniel Lezcano
2014-02-26 0:46 ` Rafael J. Wysocki
2014-03-07 12:12 ` Rafael J. Wysocki
2014-03-11 19:35 ` Rik van Riel
2014-03-11 20:07 ` Rafael J. Wysocki
2014-03-11 21:06 ` Rik van Riel
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=CAG-99FNrtBf77Kx4z3fhmpMnttnoowpqMiWFUTTMmdroBr4FYw@mail.gmail.com \
--to=tuukka.tikkanen@linaro.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.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).