From: Len Brown <lenb@kernel.org>
To: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Cc: Trinabh Gupta <trinabh@linux.vnet.ibm.com>,
Arjan van de Ven <arjan@linux.intel.com>,
peterz@infradead.org, suresh.b.siddha@intel.com,
benh@kernel.crashing.org, venki@google.com,
Andi Kleen <ak@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH V1 1/2] cpuidle: Data structure changes for global cpuidle device
Date: Fri, 01 Apr 2011 20:03:10 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.2.02.1104011954000.3461@x980> (raw)
In-Reply-To: <20110325174831.GB19214@dirshya.in.ibm.com>
> > I think the real problem that prepare() was trying to solve
> > is that the driver today does not have the ability to over-rule
> > the choice made by the governor. The driver may discover
> > in the course of trying to satisfy the request of the governor
> > that it needs to demote to a shallower state; or it may
> > do its best to satisfy the governor's request, and the hardware
> > may demote its request to a shallower state.
> >
> > Unfortunately, when this happens, the driver dutifully
> > returns the time spent in the state to cpuidle_idle_call(),
> > who then updates the wrong last_residency, time, and usage counters.
>
> I did not get this scenario. Are you saying
>
> target_state->enter(dev, target_state) can enter a different state
> than the one suggested by target_state?
Yes.
> I understand the hardware demotion part, but can we really detect the
> target 'demoted' state in that case? I guess not.
In addition to HW demotion, SW may also notice at the last minute
that some criteria for entering a state is not met, and need
to demote in SW.
Effectively it is the same as HW demotion, except SW can see
that it is going to happen ahead of time.
The example is MRST S0i3, where a number of dependencies on
SOC device state must be met to enter the state, and those
dependencies can change state at any time.
> > Sure is ironic for the driver to allocate the data structures and
> > then hand the timer to the uppper layer, just to have the upper layer
> > update the wrong data structures...
> >
> > Surely the driver enter routine should update the counters
> > that the driver was obligated to allocate, and it should return
> > the state actually entered (for tracing), rather than the time spent
> > there.
>
> Can we do something like this:
>
> last_state = target_state->enter(dev, target_state)
>
> dev->last_state and dev->last_residency are updated inside
> target_state->enter()
>
> The returned last_state is just for tracing, actual data is already
> updated in the cpuidle_dev structure and used for sysfs display.
dev->last_state and
dev->last_residency
seem like part of hacky support for run-time changing of c-states.
I think if we move the couter incrementing into the driver,
then the upper layer shouldn't need to care about it.
The driver will always have a better idea of what happened
than cpuidle_idle_call().
> > The generic cpuidle code should simply handle where the counters live
> > in the sysfs namespace, not updating the counters.
> > This needs to be addressed before cpuidle_device.cpuidle_state[]
> > can be made one/system.
>
> Agreed.
thanks,
Len Brown, Intel Open Source Technolgy Center
next prev parent reply other threads:[~2011-04-02 0:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-22 12:47 [RFC PATCH V1 0/2] cpuidle: global registration of idle states with per-cpu statistics Trinabh Gupta
2011-03-22 12:48 ` [RFC PATCH V1 1/2] cpuidle: Data structure changes for global cpuidle device Trinabh Gupta
2011-03-25 8:12 ` Len Brown
2011-03-25 17:48 ` Vaidyanathan Srinivasan
2011-04-02 0:03 ` Len Brown [this message]
2011-03-22 12:48 ` [RFC PATCH V1 2/2] cpuidle: API changes in callers using new cpuidle_state_stats Trinabh Gupta
2011-03-25 7:28 ` [RFC PATCH V1 0/2] cpuidle: global registration of idle states with per-cpu statistics Len Brown
2011-03-25 17:15 ` Vaidyanathan Srinivasan
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=alpine.LFD.2.02.1104011954000.3461@x980 \
--to=lenb@kernel.org \
--cc=ak@linux.intel.com \
--cc=arjan@linux.intel.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=suresh.b.siddha@intel.com \
--cc=svaidy@linux.vnet.ibm.com \
--cc=trinabh@linux.vnet.ibm.com \
--cc=venki@google.com \
/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
all inboxes | Powered by JetHome®