linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>,
	linux-pm@vger.kernel.org, rjw@rjwysocki.net
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/7] Cpuidle: Use actual state latency in menu governor
Date: Mon, 24 Feb 2014 23:35:40 +0100	[thread overview]
Message-ID: <530BC93C.4090907@linaro.org> (raw)
In-Reply-To: <1393223377-5744-3-git-send-email-tuukka.tikkanen@linaro.org>

On 02/24/2014 07:29 AM, Tuukka Tikkanen wrote:
> Currently menu governor records the exit latency of the state it has
> chosen for the idle period. The stored latency value is then later
> used to calculate the actual length of the idle period. This value
> may however be incorrect, as the entered state may not be the one
> chosen by the governor. The entered state information is available,
> so we can use that to obtain the real exit latency.
>
> Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>

Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> ---
>   drivers/cpuidle/governors/menu.c |    7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
> index e9a2a27..115386a 100644
> --- a/drivers/cpuidle/governors/menu.c
> +++ b/drivers/cpuidle/governors/menu.c
> @@ -124,7 +124,6 @@ struct menu_device {
>
>   	unsigned int	next_timer_us;
>   	unsigned int	predicted_us;
> -	unsigned int	exit_us;
>   	unsigned int	bucket;
>   	unsigned int	correction_factor[BUCKETS];
>   	unsigned int	intervals[INTERVALS];
> @@ -298,7 +297,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>   	}
>
>   	data->last_state_idx = 0;
> -	data->exit_us = 0;
>
>   	/* Special case when user has set very strict latency requirement */
>   	if (unlikely(latency_req == 0))
> @@ -359,7 +357,6 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>   			continue;
>
>   		data->last_state_idx = i;
> -		data->exit_us = s->exit_latency;
>   	}
>
>   	return data->last_state_idx;
> @@ -410,8 +407,8 @@ static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
>   	 * We correct for the exit latency; we are assuming here that the
>   	 * exit latency happens after the event that we're interested in.
>   	 */
> -	if (measured_us > data->exit_us)
> -		measured_us -= data->exit_us;
> +	if (measured_us > target->exit_latency)
> +		measured_us -= target->exit_latency;
>
>
>   	/* Update our correction ratio */
>


-- 
  <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:[~2014-02-24 22:35 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 [this message]
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
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=530BC93C.4090907@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=tuukka.tikkanen@linaro.org \
    /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).