All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@deeprootsystems.com>
To: linux-pm@lists.linux-foundation.org
Subject: Re: [PATCH] CPUidle: increment state counter for state actually entered
Date: Wed, 01 Oct 2008 14:00:15 +0300	[thread overview]
Message-ID: <87skrgvav4.fsf@deeprootsystems.com> (raw)
In-Reply-To: <1222858024-20369-1-git-send-email-khilman@deeprootsystems.com> (Kevin Hilman's message of "Wed\, 1 Oct 2008 13\:47\:04 +0300")

Kevin Hilman <khilman@deeprootsystems.com> writes:

> Currently, the count for state that the governor chooses is always
> incremented after the 'state_enter' hook is called.  However, the
> target's enter hook may choose a different state based on BM activity
> or other factors.
>
> This patch does the accounting use 'dev->last_state' state instead of
> the governor-chosen state.  If the target's enter_idle hook enters a
> different state than it was asked, it should update dev->last_state.
>

Oops, I sent this before I saw Venkatesh's earlier patch to do the
same.

Kevin

> ---
>  drivers/cpuidle/cpuidle.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
> index 5ce07b5..c1294f5 100644
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -67,10 +67,10 @@ static void cpuidle_idle_call(void)
>  	target_state = &dev->states[next_state];
>  
>  	/* enter the state and update stats */
> -	dev->last_residency = target_state->enter(dev, target_state);
>  	dev->last_state = target_state;
> -	target_state->time += (unsigned long long)dev->last_residency;
> -	target_state->usage++;
> +	dev->last_residency = target_state->enter(dev, target_state);
> +	dev->last_state->time += (unsigned long long)dev->last_residency;
> +	dev->last_state->usage++;
>  
>  	/* give the governor an opportunity to reflect on the outcome */
>  	if (cpuidle_curr_governor->reflect)
> -- 
> 1.6.0

  reply	other threads:[~2008-10-01 11:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 10:47 [PATCH] CPUidle: increment state counter for state actually entered Kevin Hilman
2008-10-01 11:00 ` Kevin Hilman [this message]
2008-10-01 15:35 ` Woodruff, Richard
2008-10-01 15:35 ` Woodruff, Richard
  -- strict thread matches above, loose matches on Subject: below --
2008-10-01 10:47 Kevin Hilman

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=87skrgvav4.fsf@deeprootsystems.com \
    --to=khilman@deeprootsystems.com \
    --cc=linux-pm@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.