From: trinabh@linux.vnet.ibm.com (Trinabh Gupta)
To: linux-arm-kernel@lists.infradead.org
Subject: [linux-pm] [RFC PATCH V3 1/4] cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state
Date: Thu, 21 Apr 2011 10:12:59 +0530 [thread overview]
Message-ID: <4DAFB5D3.1030804@linux.vnet.ibm.com> (raw)
In-Reply-To: <87pqog6dfw.fsf@ti.com>
On 04/20/2011 10:57 PM, Kevin Hilman wrote:
> Trinabh Gupta<trinabh@linux.vnet.ibm.com> writes:
>
>> Cpuidle subsystem only suggests the state to enter and does not
>> guarantee if the suggested state is entered. The actual entered state
>> may be different because of software or hardware demotion. Software
>> demotion is done by the back-end cpuidle driver and can be accounted
>> correctly. Current cpuidle code uses last_state field to capture the
>> actual state entered and based on that updates the statistics for the
>> state entered.
>>
>> Ideally the driver enter routine should update the counters,
>> and it should return the state actually entered rather than the time
>> spent there.
>
> OK, the return type was changed to return the state index instead of the
> time, but since the governors are still relying on dev->last_residency,
> drivers are required to update it.
>
> Because of that, why not keep the update of the time/usage counters
> in common code rather than duplicating it (9 times in this patch) into
> all the drivers?
Hi Kevin,
Thanks for your review. Yes, we can do like this and it would prevent
duplication of code. I just wanted to make cpuidle handle only selection
and entering of state, and leave everything else to the driver which
knows best about these things.
But both are functionally same and definitely statistics update inside
cpuidle_idle_call() prevents duplication of code.
Thanks,
-Trinabh
next prev parent reply other threads:[~2011-04-21 4:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 6:55 [RFC PATCH V3 0/4] cpuidle: global registration of idle states with per-cpu statistics Trinabh Gupta
2011-04-20 6:55 ` [RFC PATCH V3 1/4] cpuidle: Move dev->last_residency update to driver enter routine; remove dev->last_state Trinabh Gupta
2011-04-20 17:27 ` [linux-pm] " Kevin Hilman
2011-04-21 4:42 ` Trinabh Gupta [this message]
2011-04-20 6:55 ` [RFC PATCH V3 2/4] cpuidle: Remove CPUIDLE_FLAG_IGNORE and dev->prepare() Trinabh Gupta
2011-04-20 6:56 ` [RFC PATCH V3 3/4] Split cpuidle_state structure and move per-cpu statistics fields Trinabh Gupta
2011-04-20 6:56 ` [RFC PATCH V3 4/4] cpuidle: Single/Global registration of idle states Trinabh Gupta
2011-04-20 17:33 ` [linux-pm] " Kevin Hilman
2011-04-21 4:53 ` Trinabh Gupta
2011-04-22 23:06 ` Kevin Hilman
2011-04-25 12:00 ` Trinabh Gupta
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=4DAFB5D3.1030804@linux.vnet.ibm.com \
--to=trinabh@linux.vnet.ibm.com \
--cc=linux-arm-kernel@lists.infradead.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).