public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Surinder P Singh <srplsnh@gmail.com>
To: linux-pm@lists.linux-foundation.org
Subject: cpuidle C-state accounting
Date: Tue, 19 May 2009 09:25:04 -0700	[thread overview]
Message-ID: <20090519162504.GA26660@linux-foundation.org> (raw)

Hi,

I have a question about cpuidle C-state accounting in
cpuidle_idle_call() as implemented in kernel v2.6.29.

I understand it is possible for the target state entering callback to
return 0, if for some reason it could not enter the requested C-state
as decided by the governor. In this case, shouldn't the usage count be
updated conditionally to reflect the fact that the state may or may
not actually have been entered ? essentially, something like this:

--- cpuidle.c   2009-03-24 04:42:14.000000000 +0530
+++ cpuidle_modified.c  2009-05-19 11:39:58.000000000 +0530
@@ -86,7 +86,8 @@
                target_state = dev->last_state;

        target_state->time += (unsigned long long)dev->last_residency;
-       target_state->usage++;
+       if (dev->last_residency)
+               target_state->usage++;

        /* give the governor an opportunity to reflect on the outcome */
        if (cpuidle_curr_governor->reflect)


Cheers,
surinder

             reply	other threads:[~2009-05-19 16:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-19 16:25 Surinder P Singh [this message]
2009-05-19 21:08 ` cpuidle C-state accounting Woodruff, Richard
2009-05-20  9:36   ` Surinder P Singh
2009-05-21 17:25     ` Aneesh Bhasin
  -- strict thread matches above, loose matches on Subject: below --
2009-05-20  9:16 Surinder P Singh

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=20090519162504.GA26660@linux-foundation.org \
    --to=srplsnh@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox