So, what's the status on the recent patches here?
Subsystems (5)
I'm seeing a lot of threads without very much resolution on the differing patches that are flying around here in regards to the rework of the power management stuff (not suspend stuff...)
So, should I just grab a random patchset from here and add it to my trees and get it into -mm for testing, or does someone want to possibly guide me to the set that everyone seems to agree apon?
Or, is there two (or more) competing patch sets here that need to get resolved?
(If you can't tell I'm getting a bit annoyed at having to tell people all the time that yes, power management on Linux is bad, and yes, people are working on it, but no, I have no idea when it will ever see the light of day...)
thanks,
greg k-h
Quoted 4 lines · Greg KH
I'm seeing a lot of threads without very much resolution on the differing patches that are flying around here in regards to the rework of the power management stuff (not suspend stuff...)
RIght now there are two sets of patches with the name powerop.
One set (from Eugeny and myself) is focused on getting agreement for the PowerOP interface and operating point definition. I believe the last patchset Eugeny submitted as incorporated all the comments about
PowerOP so far. I don't think integrating PowerOP with suspend
(/sys/power/state) is appropriate at this time (as others agreed). I would rather see PowerOP accepted and used by cpufreq before we tackle suspend/resume.
The other set posted by Dave Singleton is geared towards showing how PowerOP can be used by both cpufreq and suspend code. It contains lots of features that have not been reviewed or discussed.
Quoted 3 lines
So, should I just grab a random patchset from here and add it to my trees and get it into -mm for testing, or does someone want to possibly guide me to the set that everyone seems to agree apon?
No, please don't grab a random patchset:) IMO, the patches from Eugeny and myself are the ones to grab and put into -mm. We were hoping to get some feedback on the set posted here
http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html but I
think the two patchsets have confused the situation. We are working
on the next rev of these patches which will mostly be some clean up and tighter integration with cpufreq. Our plan was to get the next rev out before we request inclusion in -mm. However if you are ready to look at and play with patches. Start with the ones at the link above.
I am a little concerned that none of the cpufreq developers have responded. I was hoping to get their feedback.
Quoted 3 lines
Or, is there two (or more) competing patch sets here that need to get resolved?
I don't view the two patchsets as competing. Eugeny and I are focused on getting the basic building block necessary to do advanced frequency and voltage scaling accepted. If we can get PowerOP in the mainline,
then we can add more feature by feature. As Dave outlined in his
email, his patches are a starting point for further discussion about integrating with other subsystems and additional features. Let's focus on getting PowerOP accepted by starting with Eugeny's patches which provides powerop as a separate component and integration with cpufreq.
Quoted 5 lines
(If you can't tell I'm getting a bit annoyed at having to tell people all the time that yes, power management on Linux is bad, and yes, people
are working on it, but no, I have no idea when it will ever see the light of day...)
Well, we are working on it. I think we had some really good discussion/feedback over the last weeks and we are almost there. Unfortunately, the discussion tapered off recently when we needed some final feedback. Probably related to having two patchsets with the name powerop. Let's try to get something acceptable in -mm over the next couple days.
Thanks
Matt
Quoted 9 lines
thanks,
greg k-h
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 2 lines · Matthew Locke
I am a little concerned that none of the cpufreq developers have responded. I was hoping to get their feedback.
I was waiting for the dust to settle before spending a significant amount of time reviewing. I have to admit, the two patchsets thing did confuse me too. (Though I've also been swamped with bugs since I got back from OLS, so I've appreciated the breathing room :)
If we're arriving any closer to consensus on whats mergable from the cpufreq side, and what needs more input, I'll find the time to review soon, but there still seems to be ongoing discussion which is why I decided to leave it sort itself out :)
Quoted 7 lines
Quoted 5 lines
(If you can't tell I'm getting a bit annoyed at having to tell people all the time that yes, power management on Linux is bad, and yes, people
are working on it, but no, I have no idea when it will ever see the light of day...)Well, we are working on it.
Sadly powerop is but a tiny piece of the puzzle.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 9 lines · Dave Jones
Quoted 2 lines · Matthew Locke
I am a little concerned that none of the cpufreq developers have responded. I was hoping to get their feedback.
I was waiting for the dust to settle before spending a significant amount of time reviewing. I have to admit, the two patchsets thing did confuse me too. (Though I've also been swamped with bugs since I got back from OLS, so I've appreciated the breathing room :)
Yeah, I understand that. I'm still catching up as well.
Quoted 5 lines
If we're arriving any closer to consensus on whats mergable from the cpufreq side, and what needs more input, I'll find the time to review soon, but there still seems to be ongoing discussion which is why I decided to leave it sort itself out :)
I think we are at the stage of need more input on the last set of Eugeny's patches. (the ones I point to in my email) The cpufreq patches, so far, are more for example. We need a bit of work before they are ready for merging. However, I would prefer to have your feedback now rather than later.
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
(If you can't tell I'm getting a bit annoyed at having to tell people all the time that yes, power management on Linux is bad, and yes, people
are working on it, but no, I have no idea when it will ever see the light of day...)Well, we are working on it.
Sadly powerop is but a tiny piece of the puzzle.
Cheer up guys. Power management will get better one piece at a time; just like the rest of Linux:)
Quoted 6 lines
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 10 lines · Matthew Locke
Quoted 4 lines
If we're arriving any closer to consensus on whats mergable from the cpufreq side, and what needs more input, I'll find the time to review soon, but there still seems to be ongoing discussion which is why I decided to leave it sort itself out :)
I think we are at the stage of need more input on the last set of Eugeny's patches. (the ones I point to in my email) The cpufreq patches, so far, are more for example. We need a bit of work before they are ready for merging. However, I would prefer to have your feedback now rather than later.
I gave them a quick lookover, and there are the to-be-expected minor nits, but there's something more fundamental that I'm still not getting.
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of view, what does adding this buy us? What problem do we have today that is being solved by all this?
Every explanation of powerop I've seen so far dives into microdetails, whilst the 10,000ft view has always passed me by other than "this is what we've had in the embedded world".
The diagram at http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html
also confuses me. I was under the impression that powerop was adding additional userspace interfaces. If we're not changing how things from a userspace point of view, we're churning a lot of kernel code,.. why?
Clue me in here, I'm feeling thick.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 10 lines · Dave Jones
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of view, what does adding this buy us? What problem do we have today that is being solved by all this?
Every explanation of powerop I've seen so far dives into microdetails, whilst the 10,000ft view has always passed me by other than "this is what we've had in the embedded world".
Quoted 6 lines
The diagram at http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html
also confuses me. I was under the impression that powerop was adding additional userspace interfaces. If we're not changing how things from a userspace point of view, we're churning a lot of kernel code,.. why?Clue me in here, I'm feeling thick.
You're not alone, I really don't get it either.
But I guess we'll just wait for the next round of unified patches and then go from there.
thanks,
greg k-h
Quoted 14 lines · Greg Kroah-Hartman
Quoted 14 lines
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of view, what does adding this buy us? What problem do we have today that is being solved by all this?
Every explanation of powerop I've seen so far dives into microdetails, whilst the 10,000ft view has always passed me by other than "this is what we've had in the embedded world".
The diagram at http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html
also confuses me. I was under the impression that powerop was adding additional userspace interfaces. If we're not changing how things from a userspace point of view, we're churning a lot of kernel code,.. why?
Quoted 6 lines
Quoted 1 line
Clue me in here, I'm feeling thick.
You're not alone, I really don't get it either.
But I guess we'll just wait for the next round of unified patches and then go from there.
I have concerns over this because the cpufreq code has gotten pretty damned complicated in parts, and it's really impacting our ability to fix bugs in the thing. Every time something new falls out we have to play archaeologist looking up a lot of ancient changes to figure why we did x in y way, and why z didn't work, and it's getting quite unfun. In a lot of cases even the original authors of the problematic parts can't remember their reasoning.
I've got a fairly good handle on most parts, but things like the recent cpufreq vs hotplug-cpu fiasco (which went in via some other route rather than the cpufreq tree) really threw me a curve-ball, and no-one other than Linus, Andrew and myself stepped up to the plate to fix that mess, despite there being the better part of a half dozen people who had hacked on it during its integration.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 16 lines · ext Greg KH
Quoted 15 lines · Dave Jones
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of view, what does adding this buy us? What problem do we have today that is being solved by all this?
Every explanation of powerop I've seen so far dives into microdetails, whilst the 10,000ft view has always passed me by other than "this is what we've had in the embedded world".
The diagram at http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html
also confuses me. I was under the impression that powerop was adding additional userspace interfaces. If we're not changing how things from a userspace point of view, we're churning a lot of kernel code,.. why?
Quoted 6 lines
Quoted 1 line
Clue me in here, I'm feeling thick.
You're not alone, I really don't get it either.
But I guess we'll just wait for the next round of unified patches and then go from there.
Here is my shot at providing a 10,000ft view:
a. For embedded platforms, cpufreq just does not cut it when specifying an operating point for the device. These platforms use tuples such as
<voltage, pll_freq, core1_freq, core2_freq, interconnect_freq>
to signify an 'operating point'. Note that core1 and core2 can be totally different processors e.g. ARM and DSP. x86 platforms hide this complexity behind ACPI.
b. The clocking and voltage dependency tree in embedded devices can be summarised in the clock framework ( find ./arch -name clock* ) and soon-to-be-available voltage framework. These is again done to large extent by ACPI on x86.
c. PowerOP provides an interface, that most embedded developers agree, is a good starting point to encapsulate platform information in a consistent way without having to resort to subarch-specific kludges.
d. In the end, all this is leading to an interface for a user-space policy manager that will control _system_ power state based on constraints imposed by HW peripherals or on policies implemented by device manufacturer/distro maintainer.
In conclusion, PowerOP only allows embedded platforms to join the PM fun without affecting cpufreq-supported platforms adversely. Or that is the original idea. If that rule is being violated, please feel free to point that out.
The way forward as I see is:
1. PowerOP integration into mainline [patch 1/3]
- PM Core drivers (OMAP, x86) [patch 2/3]
- cpufreq drivers modified to use PowerOP (OMAP, x86) [patch 3/3]
At this point, PowerOP is an optional component in mainline tree. Cpufreq drivers can _choose_ to use it or not. But now embedded platforms can do the PM dance in a consistent way.
2. Support for more architectures - PPC, x86_64, XScale, MIPS? Platform expertise needed here.
3. Move clock/voltage framework from arch/arm to kernel/clock and kernel/voltage. This would allow more embedded platforms and potentially future PC platforms to utilise the framework for 'automated' clock/voltage dependency management.
4. Userspace policy managers are created to provide basic control of system operating points. Embedded system integrators might want to extend these policy managers to fully utilise the 'knobs' available on their platforms.
5. <Crystal Ball Gazing/Wishful Thinking>
- Clock/Voltage FW <--> ACPI logical mappings allows us to use global state names in /sys/power/state for system power state transitions.
- Drivers on PC platforms are fixed to use/unuse resources dynamically to allow asynchronous peripheral power state transitions. Embedded platforms use clock framework for this.
- PowerOP can address needs of all platforms, allowing removal of cpufreq.
</CBG/WT>
Regards,
Amit
Signature · 2 lines
Amit Kucheria <[email protected]> Nokia
Quoted 10 lines · Amit Kucheria
Here is my shot at providing a 10,000ft view:
a. For embedded platforms, cpufreq just does not cut it when specifying an operating point for the device. These platforms use tuples such as
<voltage,
pll_freq,core1_freq,core2_freq,interconnect_freq>to signify an 'operating point'. Note that core1 and core2 can be totally different processors e.g. ARM and DSP. x86 platforms hide this complexity behind ACPI.
If there are dependancies inherently linking core1 and core2, cpufreq should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't any dependancy between them, I don't see the attraction of creating an artificial one in the way suggested for no real purpose.
Things like voltage and frequency are closely tied together, so offering any means of controlling them independantly makes no sense afaics.
Quoted 4 lines
b. The clocking and voltage dependency tree in embedded devices can be summarised in the clock framework ( find ./arch -name clock* ) and soon-to-be-available voltage framework. These is again done to large extent by ACPI on x86.
Of the 14 x86 cpufreq drivers, 3 of them _optionally_ use ACPI. powernow-k7 for example doesn't use it, and is possibly one of the most stable cpufreq drivers we've had in the tree (for x86 at least).
Quoted 4 lines
d. In the end, all this is leading to an interface for a user-space policy manager that will control _system_ power state based on constraints imposed by HW peripherals or on policies implemented by device manufacturer/distro maintainer.
How does that interface look from a userspace point of view ? Hopefully not anything like the tuple described above. Why would userspace ever care about "interconnect freq" ?
Userspace cares about "save power" or "go fast".
Historically, I wish we had never exposed frequencies, but instead a performance percentage, so that the various userspace tools didn't have to care about things like 'what frequencies are available'. Adding the same mistake for voltages doesn't strike me as a fantastic idea.
Quoted 3 lines
At this point, PowerOP is an optional component in mainline tree. Cpufreq drivers can _choose_ to use it or not. But now embedded platforms can do the PM dance in a consistent way.
That's about the only part I really like so far. The option to opt-out where it makes absolutely no sense to pointlessly abstract stuff (which for x86 seems to be the case). For ARM, I'm going to leave Russell to comment/review.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 23 lines · ext Dave Jones
Quoted 3 lines · Amit Kucheria
Here is my shot at providing a 10,000ft view:
a. For embedded platforms, cpufreq just does not cut it when
specifying
Quoted 1 line
an operating point for the device. These platforms use tuples such
as
Quoted 5 lines
<voltage,
pll_freq,core1_freq,core2_freq,interconnect_freq>to signify an 'operating point'. Note that core1 and core2 can be totally different processors e.g. ARM and DSP. x86 platforms hide
this
Quoted 1 line
complexity behind ACPI.
If there are dependancies inherently linking core1 and core2, cpufreq should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't any dependancy
between them, I don't see the attraction of creating an artificial one in the way suggested for no real purpose.
Quoted 3 lines
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no sense afaics.
Yet a certain subsystem (for example an onboard camera, in a phone) might require a higher voltage when it's active, effectively loosening the tight coupling between freq and voltage that the porcessor is enforcing.
Quoted 22 lines
Quoted 2 lines
b. The clocking and voltage dependency tree in embedded devices can
be
Quoted 2 lines
summarised in the clock framework ( find ./arch -name clock* ) and soon-to-be-available voltage framework. These is again done to
large
Quoted 1 line
extent by ACPI on x86.
Of the 14 x86 cpufreq drivers, 3 of them _optionally_ use ACPI. powernow-k7 for example doesn't use it, and is possibly one of the most
stable cpufreq drivers we've had in the tree (for x86 at least).Quoted 4 lines
d. In the end, all this is leading to an interface for a user-space policy manager that will control _system_ power state based on constraints imposed by HW peripherals or on policies implemented by device manufacturer/distro maintainer.
How does that interface look from a userspace point of view ? Hopefully not anything like the tuple described above. Why would userspace ever care about "interconnect freq" ?
Quoted 7 lines
Userspace cares about "save power" or "go fast". Historically, I wish we had never exposed frequencies, but instead a performance percentage, so that the various userspace tools didn't have to care about things like 'what frequencies are available'.
Adding the same mistake for voltages doesn't strike me as a fantastic idea.
Such generic definitions are not enough for embedded userspace, the complexity of the tuning is expected and accepted as long as it allows to leverage the HW performance.
Quoted 20 lines
Quoted 4 lines
At this point, PowerOP is an optional component in mainline tree. Cpufreq drivers can _choose_ to use it or not. But now embedded platforms can do the PM dance in a consistent way.
That's about the only part I really like so far. The option to opt-out where it makes absolutely no sense to pointlessly abstract stuff (which for x86 seems to be the case). For ARM, I'm going to leave Russell to comment/review.
Dave
--
http://www.codemonkey.org.uk
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
Signature · 4 lines
Cheers,
Igor
Igor Stoppa (Nokia M - OSSO / Tampere)Hi!
Quoted 7 lines
Quoted 7 lines
If there are dependancies inherently linking core1 and core2, cpufreq should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't any dependancy
between them, I don't see the attraction of creating an artificial one in the way suggested for no real purpose.
Quoted 8 lines
Quoted 3 lines
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no sense afaics.Yet a certain subsystem (for example an onboard camera, in a phone) might require a higher voltage when it's active, effectively loosening the tight coupling between freq and voltage that the porcessor is enforcing.
So... you expect userland to echo high > state before camera can be used?
I'd rather have kernel automagically up the voltage when /dev/video0 is opened...
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 18 lines · ext Pavel Machek
Hi!
Quoted 1 line
Quoted 1 line
If there are dependancies inherently linking core1 and core2,
cpufreq
Quoted 4 lines
Quoted 4 lines
should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't any dependancy
between them, I don't see the attraction of creating an artificialone
Quoted 8 lines
Quoted 5 lines
in the way suggested for no real purpose.
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no sense afaics.Yet a certain subsystem (for example an onboard camera, in a phone) might require a higher voltage when it's active, effectively
loosening
Quoted 8 lines
Quoted 2 lines
the tight coupling between freq and voltage that the porcessor is enforcing.
So... you expect userland to echo high > state before camera can be used?
I'd rather have kernel automagically up the voltage when
/dev/video0is opened...
Not really, I meant that the CPU is not the only customer of power domains (depend on the HW design), so the relation freq <-> voltage is not always true.
Signature · 4 lines
Cheers,
Igor
Igor Stoppa (Nokia M - OSSO / Tampere)Quoted 23 lines · Igor Stoppa
Quoted 22 lines · ext Pavel Machek
Hi!
Quoted 1 line
Quoted 1 line
If there are dependancies inherently linking core1 and core2,
cpufreq
Quoted 4 lines
Quoted 4 lines
should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't any dependancy
between them, I don't see the attraction of creating an artificialone
Quoted 7 lines
Quoted 5 lines
in the way suggested for no real purpose.
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no sense afaics.Yet a certain subsystem (for example an onboard camera, in a phone) might require a higher voltage when it's active, effectively
loosening
Quoted 2 lines
the tight coupling between freq and voltage that the porcessor is enforcing.
So... you expect userland to echo high > state before camera can be used?
Quoted 7 lines
Quoted 2 lines
I'd rather have kernel automagically up the voltage when
/dev/video0is opened...Not really, I meant that the CPU is not the only customer of power domains (depend on the HW design), so the relation freq <-> voltage is not always true.
Then you need to introduce power domains and associate your devices with them, isn't it? So if your camera appears in the same domain with CPU, the voltage of
that domain will go up either with camera=on, or CPU going to higher frequency.
Quoted 34 lines · ext Alexey Starikovskiy
Quoted 7 lines · Igor Stoppa
Quoted 6 lines · ext Pavel Machek
Hi!
Quoted 1 line
Quoted 1 line
If there are dependancies inherently linking core1 and core2,
cpufreq
Quoted 2 lines
Quoted 2 lines
should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't
any
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
dependancy
between them, I don't see the attraction of creating anartificial
Quoted 6 lines
Quoted 6 lines
one
Quoted 5 lines
Quoted 5 lines
in the way suggested for no real purpose.
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no senseafaics.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Yet a certain subsystem (for example an onboard camera, in a
phone)
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
might require a higher voltage when it's active, effectively
loosening
Quoted 2 lines
the tight coupling between freq and voltage that the porcessor is enforcing.
So... you expect userland to echo high > state before camera can be used?
I'd rather have kernel automagically up the voltage
when
/dev/video0Quoted 4 lines
Quoted 1 line
is opened...
Not really, I meant that the CPU is not the only customer of power domains (depend on the HW design), so the relation freq <-> voltage
Quoted 8 lines
is
Quoted 2 lines
not always true.
Then you need to introduce power domains and associate your devices with them, isn't it?
So if your camera appears in the same domain with CPU, the voltage of that domain will go up either with camera=on, or CPU going to higher frequency.
I used the expression "power domain" to refer to a generic domain, either voltage or frequency, to indicate that changing either freq or voltage in a domain implies changing the domain power level.
Of course it is changing linearly with frequency, while the dependency from voltage is quadratic.
So in the camera example we might have 2 different cases:
-the one mentioned above, where the camera shares the same voltage domain with CPU and the correlation is the one you described
-another case where the clock frequency provided to the camera is related to the resolution being used
camera off => no constraints
low res => low freq, high voltage
high res => high freq, high voltage
in such case the currently active resolution would affect whatever device shares the camera clock, if any.
But no need to introduce power domains.
Signature · 4 lines
Cheers,
Igor
Igor Stoppa (Nokia M - OSSO / Tampere)Quoted 58 lines · Igor Stoppa
Quoted 33 lines · ext Alexey Starikovskiy
Quoted 7 lines · Igor Stoppa
Quoted 6 lines · ext Pavel Machek
Hi!
Quoted 1 line
Quoted 1 line
If there are dependancies inherently linking core1 and core2,
cpufreq
Quoted 2 lines
Quoted 2 lines
should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't
any
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
dependancy
between them, I don't see the attraction of creating anartificial
Quoted 6 lines
Quoted 6 lines
one
Quoted 5 lines
Quoted 5 lines
in the way suggested for no real purpose.
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no senseafaics.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Yet a certain subsystem (for example an onboard camera, in a
phone)
Quoted 8 lines
Quoted 8 lines
Quoted 1 line
might require a higher voltage when it's active, effectively
loosening
Quoted 2 lines
the tight coupling between freq and voltage that the porcessor is enforcing.
So... you expect userland to echo high > state before camera can be used?
I'd rather have kernel automagically up the voltage
when
/dev/video0Quoted 3 lines
Quoted 1 line
is opened...
Not really, I meant that the CPU is not the only customer of power domains (depend on the HW design), so the relation freq <-> voltage
Quoted 8 lines
is
Quoted 2 lines
not always true.
Then you need to introduce power domains and associate your devices with them, isn't it?
So if your camera appears in the same domain with CPU, the voltage of that domain will go up either with camera=on, or CPU going to higher frequency.I used the expression "power domain" to refer to a generic domain, either voltage or frequency, to indicate that changing either freq or voltage in a domain implies changing the domain power level.
Of course it is changing linearly with frequency, while the dependency from voltage is quadratic.
So in the camera example we might have 2 different cases:
-the one mentioned above, where the camera shares the same voltage domain with CPU and the correlation is the one you described
-another case where the clock frequency provided to the camera is related to the resolution being used
Quoted 9 lines
camera off => no constraints
low res => low freq, high voltage
high res => high freq, high voltagein such case the currently active resolution would affect whatever device shares the camera clock, if any.
But no need to introduce power domains.
How about introducing a frequency domain as well?
Quoted 71 lines · ext Alexey Starikovskiy
Quoted 8 lines · Igor Stoppa
Quoted 7 lines · ext Alexey Starikovskiy
Quoted 6 lines · Igor Stoppa
Quoted 5 lines · ext Pavel Machek
Hi!
Quoted 1 line
Quoted 1 line
If there are dependancies inherently linking core1 and core2,
cpufreq
Quoted 1 line
Quoted 1 line
should already be programming both parts. For example, the
SA1100
Quoted 11 lines
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
driver programs both CPU and SDRAM controller. If there isn't
any
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
dependancy
between them, I don't see the attraction of creating anartificial
Quoted 6 lines
Quoted 6 lines
one
Quoted 5 lines
Quoted 5 lines
in the way suggested for no real purpose.
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no senseQuoted 6 lines
Quoted 6 lines
afaics.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Yet a certain subsystem (for example an onboard camera, in a
phone)
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
might require a higher voltage when it's active, effectively
loosening
Quoted 1 line
the tight coupling between freq and voltage that the porcessor
is
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
enforcing.
So... you expect userland to echo high > state before camera can
be
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
used?
I'd rather have kernel automagically up the voltage
when
/dev/video0Quoted 3 lines
Quoted 1 line
is opened...
Not really, I meant that the CPU is not the only customer of power domains (depend on the HW design), so the relation freq <->
voltage
Quoted 6 lines
Quoted 6 lines
is
Quoted 2 lines
not always true.
Then you need to introduce power domains and associate your devices with them, isn't it?
So if your camera appears in the same domain with CPU, the voltageof
Quoted 1 line
Quoted 1 line
that domain will go up either with camera=on, or CPU going to
higher
Quoted 4 lines
Quoted 1 line
frequency.
I used the expression "power domain" to refer to a generic domain, either voltage or frequency, to indicate that changing either freq
or
Quoted 3 lines
voltage in a domain implies changing the domain power level.
Of course it is changing linearly with frequency, while the
dependency
Quoted 14 lines
from voltage is quadratic.
So in the camera example we might have 2 different cases:
-the one mentioned above, where the camera shares the same voltage domain with CPU and the correlation is the one you described
-another case where the clock frequency provided to the camera is related to the resolution being used
camera off => no constraints
low res => low freq, high voltage
high res => high freq, high voltage
Quoted 6 lines
Quoted 5 lines
in such case the currently active resolution would affect whatever device shares the camera clock, if any.
But no need to introduce power domains.
How about introducing a frequency domain as well?
The clock framework deals with clock correlations and dependencies.
Signature · 4 lines
Cheers,
Igor
Igor Stoppa (Nokia M - OSSO / Tampere)Quoted 14 lines · Dave Jones
Quoted 11 lines · Amit Kucheria
Here is my shot at providing a 10,000ft view:
a. For embedded platforms, cpufreq just does not cut it when specifying
an operating point for the device. These platforms use tuples such as<voltage,
pll_freq,core1_freq,core2_freq,interconnect_freq>to signify an 'operating point'. Note that core1 and core2 can be totally different processors e.g. ARM and DSP. x86 platforms hide this complexity behind ACPI.
Quoted 6 lines
If there are dependancies inherently linking core1 and core2, cpufreq should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't any dependancy
between them, I don't see the attraction of creating an artificial one in the way suggested for no real purpose.
Are you arguing against the operating point concept because it creates an artificial dependency? I assume your definition of dependency means a physical dependency.
The operating point represents both a physical and operational
dependency. It is a collection of parameters that can/will be adjusted to reduce power consumption. However, adjusting these parameters can have a severe impact to performance and operational state of the system. The parameters can not be adjusted individually and still
achieve the goal of an operational and power efficient system. SoC's
have a fixed number of values in a fixed number of combinations that keep the system operational and power efficient. Using power op, a piece of controlling software can tell the system to go to specific instance of the power parameters that provide the best combination of power savings and performance/operational integrity according to the current state of the system. This instance is represented by a string.
PowerOP is needed to do advanced power management on embedded mobile devices.
Quoted 4 lines
Things like voltage and frequency are closely tied together, so offering
any means of controlling them independantly makes no sense afaics.
It's not about controlling parameters independently. We need to be able to control them as described above.
Quoted 19 lines
Quoted 5 lines
b. The clocking and voltage dependency tree in embedded devices can be summarised in the clock framework ( find ./arch -name clock* ) and soon-to-be-available voltage framework. These is again done to large extent by ACPI on x86.
Of the 14 x86 cpufreq drivers, 3 of them _optionally_ use ACPI. powernow-k7 for example doesn't use it, and is possibly one of the most stable cpufreq drivers we've had in the tree (for x86 at least).
Quoted 4 lines
d. In the end, all this is leading to an interface for a user-space policy manager that will control _system_ power state based on constraints imposed by HW peripherals or on policies implemented by device manufacturer/distro maintainer.
How does that interface look from a userspace point of view ? Hopefully not anything like the tuple described above. Why would userspace ever care about "interconnect freq" ?
Quoted 6 lines
Userspace cares about "save power" or "go fast". Historically, I wish we had never exposed frequencies, but instead a performance percentage, so that the various userspace tools didn't have to care about things like 'what frequencies are available'. Adding the same mistake for voltages doesn't strike me as a fantastic idea.
I'm not sure I follow your comments here. We are not making the same mistake. In fact we are fixing it with PowerOP. The power parameters are represented by a name and you create whatever name makes sense for your system. In fact the names can all be the same for the various x86 platforms if you so desire. The abstraction allows userspace to use the name and not know anything about the frequencies or voltages. As Scott pointed out, some power managers will need to know lots of architecture and board specific details to be able to reduce power consumption and keep the system operational. The abstraction enables this as well.
Quoted 9 lines
Quoted 4 lines
At this point, PowerOP is an optional component in mainline tree. Cpufreq drivers can _choose_ to use it or not. But now embedded platforms can do the PM dance in a consistent way.
That's about the only part I really like so far. The option to opt-out where it makes absolutely no sense to pointlessly abstract stuff (which for x86 seems to be the case). For ARM, I'm going to leave Russell to comment/review.
I'm not following why you think PowerOP isn't needed for x86. It seems to address the issues with cpufreq that you point out above. The conclusion we reached at the PM summit was that cpufreq/PowerOP integration was useful and desired.
If we need to, I'm happy to put the integration of cpufreq/PowerOP aside and just work on getting PowerOP accepted.
Quoted 10 lines
Dave
Signature · 5 lines
http://www.codemonkey.org.uk _______________________________________________ linux-pm mailing list [email protected] https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 11 lines · Matthew Locke
Quoted 5 lines · Dave Jones
If there are dependancies inherently linking core1 and core2, cpufreq should already be programming both parts. For example, the SA1100 driver programs both CPU and SDRAM controller. If there isn't any dependancy between them, I don't see the attraction of creating an artificial one in the way suggested for no real purpose.
Are you arguing against the operating point concept because it creates an artificial dependency? I assume your definition of dependency means a physical dependency.
Quoted 13 lines
The operating point represents both a physical and operational
dependency. It is a collection of parameters that can/will be adjusted to reduce power consumption. However, adjusting these parameters can have a severe impact to performance and operational state of the system. The parameters can not be adjusted individually and still
achieve the goal of an operational and power efficient system. SoC's
have a fixed number of values in a fixed number of combinations that keep the system operational and power efficient. Using power op, a piece of controlling software can tell the system to go to specific instance of the power parameters that provide the best combination of power savings and performance/operational integrity according to the current state of the system. This instance is represented by a string.
The core1 and core interdependencies are something that cpufreq doesn't handle particularly well. If it's something as simple as recalibrating your baud rate generator or adjusting the SDRAM controller, these are all things that need to be done for normal operation to continue, not things that end up being exposed or configurable, so it tends to largely ignore the interdependency issue.
The problem occurs when you have independent cores that want to be throttled or scaled independently, yet still have some fixed dependency between them (say, enabling a synchronization circuit), where failure to handle this will ultimately result in core reset or otherwise undefined behaviour.
In order to handle this cleanly, one would need multiple drivers for each core, as well as some shared common code for handling the clocks, voltage, and sanity checks. This alone already begins to enter the scope for what things like PowerOP are reasonably suited for. The operating point semantics work well here, as independent core states can be trivially defined based off of vendor-defined usage profiles. It's necessary to have a big picture view of the operating point in order to sanely handle sanity checks and rate validation, which is something that gets rather ugly with cpufreq without referencing common validation code between each core (which will also cause problems for code reuse in the cases where one of the cores is used in another processor).
PowerOP seems well suited for these sorts of cases, and it's not clear that trying to beat cpufreq in to submission will offer any benefits in this case, particularly since it's something x86 people largely don't seem to care about, given that ACPI does most of the heavy lifting.
Quoted 10 lines · ext Dave Jones
Quoted 5 lines
d. In the end, all this is leading to an interface for a user-space policy manager that will control _system_ power state based on constraints imposed by HW peripherals or on policies implemented by device manufacturer/distro maintainer.
How does that interface look from a userspace point of view ? Hopefully not anything like the tuple described above. Why would userspace ever care about "interconnect freq" ?
Quoted 7 lines
Userspace cares about "save power" or "go fast". Historically, I wish we had never exposed frequencies, but instead a performance percentage, so that the various userspace tools didn't have to care about things like 'what frequencies are available'.
Adding the same mistake for voltages doesn't strike me as a fantastic idea.
The userspace interface in Eungeny's patches is for other userspace programs (policy managers) to activate/deactivate valid operating points in the system dynamically and if necessary, introduce new ones into the system. It will also allow the operating points to be referenced by name instead of the tuple.
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
Regards,
Amit
Signature · 2 lines
Amit Kucheria <[email protected]> Nokia
Hi!
Quoted 14 lines
Quoted 7 lines
Userspace cares about "save power" or "go fast". Historically, I wish we had never exposed frequencies, but instead a performance percentage, so that the various userspace tools didn't have to care about things like 'what frequencies are available'.
Adding the same mistake for voltages doesn't strike me as a fantastic idea.The userspace interface in Eungeny's patches is for other userspace programs (policy managers) to activate/deactivate valid operating points in the system dynamically and if necessary, introduce new ones into the system. It will also allow the operating points to be referenced by name instead of the tuple.
Quoted 3 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 8 lines · Pavel Machek
Quoted 3 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
I guess it just defines an appropriate policy. You can call it 'usb_mp3' if you wish ;)
I don't think it's too embedded-specific.
Vitaly
Quoted 5 lines · Pavel Machek
Quoted 4 lines
Quoted 3 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
Quoted 8 lines
Quoted 4 lines
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
I guess it just defines an appropriate policy. You can call it '
usb_mp3' if you wish ;)
I don't think it's too embedded-specific.
Well, it leads to exponential number of policies -- not nice. Having usb_mp3_fileserver_webserver is not nice.
Pavel
Signature · 1 line
Thanks, Sharp!
Quoted 11 lines · ext Pavel Machek
Quoted 3 lines · Pavel Machek
Quoted 2 lines
Quoted 2 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point
based on
Quoted 7 lines
Quoted 6 lines
Quoted 1 line
configuration of the policy manager.
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Quoted 6 lines
Quoted 3 lines
I guess it just defines an appropriate policy. You can call it '
usb_mp3' if you wish ;)
I don't think it's too embedded-specific.Well, it leads to exponential number of policies -- not nice. Having
usb_mp3_fileserver_webserveris not nice.
The whole idea is that you have generic "good enough" policies for unknown cases-combinations, plus specific policies for well known cases. This tends to be simpler for embedded systems, of course.
But even for your laptops you can identify few major use cases, that incidentally tend to overlap with embedded devices use cases:
-mp3
-video
-browsing
-name your own
...
Signature · 4 lines
Cheers,
Igor
Igor Stoppa (Nokia M - OSSO / Tampere)Quoted 6 lines · Pavel Machek
Quoted 6 lines
Quoted 5 lines
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Quoted 6 lines
Quoted 3 lines
I guess it just defines an appropriate policy. You can call it '
usb_mp3' if you wish ;)
I don't think it's too embedded-specific.Well, it leads to exponential number of policies -- not nice. Having
usb_mp3_fileserver_webserveris not nice.
No. The reason is there's no _real_ difference in 'fileserver' and 'webserver' from the PM POV, so this will never happen. There's no reason to introduce different policies for different use cases which however imply similar peripherals utilization. Moreover, I never play MP3s on a fileserver/webserver. The example you've given is pretty much artificial.
Vitaly
Quoted 14 lines · Vitaly Wool
Quoted 6 lines · Pavel Machek
Quoted 6 lines
Quoted 5 lines
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Quoted 6 lines
Quoted 3 lines
I guess it just defines an appropriate policy. You can call it '
usb_mp3' if you wish ;)
I don't think it's too embedded-specific.Well, it leads to exponential number of policies -- not nice. Having
usb_mp3_fileserver_webserveris not nice.
Quoted 6 lines
No. The reason is there's no _real_ difference in 'fileserver' and 'webserver' from the PM POV, so this will never happen. There's no reason to introduce different policies for different use cases which however imply similar peripherals utilization. Moreover, I never play MP3s on a fileserver/webserver. The example you've given is pretty much artificial.
My notebook has 23 different devices. Do you really want to have 8388608 policies for different perihepal utilizations?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 9 lines · Pavel Machek
Quoted 6 lines
No. The reason is there's no _real_ difference in 'fileserver' and 'webserver' from the PM POV, so this will never happen. There's no reason to introduce different policies for different use cases which however imply similar peripherals utilization. Moreover, I never play MP3s on a fileserver/webserver. The example you've given is pretty much artificial.
My notebook has 23 different devices. Do you really want to have 8388608 policies for different perihepal utilizations?
Can you please elaborate on how this number corresponds to the reality? Looks like you don't catch what I'm saying. I'm talking about use case-driven model in which you will need to invent 8388608 use cases basically in order to have 8388608 policies. IOW, not any combination is valid within these 8388608.
Vitaly
Hi!
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
No. The reason is there's no _real_ difference in 'fileserver' and 'webserver' from the PM POV, so this will never happen. There's no reason to introduce different policies for different use cases which however imply similar peripherals utilization. Moreover, I never play MP3s on a fileserver/webserver. The example you've given is pretty much artificial.
Quoted 8 lines
Quoted 2 lines
My notebook has 23 different devices. Do you really want to have 8388608 policies for different perihepal utilizations?
Can you please elaborate on how this number corresponds to the reality? Looks like you don't catch what I'm saying. I'm talking about use case-driven model in which you will need to invent 8388608 use cases basically in order to have 8388608 policies. IOW, not any combination is valid within these 8388608.
I'm saying that usecase-driven model is not acceptable for a kernel. It is not kernel's business to limit user to particular usage models.
That's why your model works for closed machines like a cellphones, but is totally broken for notebook. Sorry.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Hi Pavel,
Quoted 18 lines · Pavel Machek
Hi!
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
No. The reason is there's no _real_ difference in 'fileserver' and 'webserver' from the PM POV, so this will never happen. There's no reason to introduce different policies for different use cases which however imply similar peripherals utilization. Moreover, I never play MP3s on a fileserver/webserver. The example you've given is pretty much artificial.
Quoted 8 lines
Quoted 2 lines
My notebook has 23 different devices. Do you really want to have 8388608 policies for different perihepal utilizations?
Can you please elaborate on how this number corresponds to the reality? Looks like you don't catch what I'm saying. I'm talking about use case-driven model in which you will need to invent 8388608 use cases basically in order to have 8388608 policies. IOW, not any combination is valid within these 8388608.
Quoted 6 lines
I'm saying that usecase-driven model is not acceptable for a kernel. It is not kernel's business to limit user to particular usage models.
That's why your model works for closed machines like a cellphones, but is totally broken for notebook. Sorry.
Who talks about kernel? A policy is an userspace thing. I guess we're not quite understanding each other :)
Vitaly
Quoted 25 lines · Vitaly Wool
Hi Pavel,
Quoted 22 lines · Pavel Machek
Hi!
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
No. The reason is there's no _real_ difference in 'fileserver' and 'webserver' from the PM POV, so this will never happen. There's no reason to introduce different policies for different use cases which however imply similar peripherals utilization. Moreover, I never play MP3s on a fileserver/webserver. The example you've given is pretty much artificial.
Quoted 8 lines
Quoted 2 lines
My notebook has 23 different devices. Do you really want to have 8388608 policies for different perihepal utilizations?
Can you please elaborate on how this number corresponds to the reality? Looks like you don't catch what I'm saying. I'm talking about use case-driven model in which you will need to invent 8388608 use cases basically in order to have 8388608 policies. IOW, not any combination is valid within these 8388608.
I'm saying that usecase-driven model is not acceptable for a kernel. It is not kernel's business to limit user to particular usage models.
Quoted 5 lines
Quoted 2 lines
That's why your model works for closed machines like a cellphones, but is totally broken for notebook. Sorry.
Who talks about kernel? A policy is an userspace thing. I guess we're not quite understanding each other :)
You upload policies to kernel. You want 5 policies for your cellphone, and thats fine, but I'm telling you I'd need 8388608 policies for my notebook, because devices are independent and users want separate control.
Because 8388608 policies is clearly not reasonable, powerop can not help here, and something better should be developed... like power domains someone proposed here.
(Or to say it in another words, powerop forces one big power domain, which is bad model for notebook-style machine).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 29 lines · Pavel Machek
Quoted 28 lines · Vitaly Wool
Hi Pavel,
Quoted 24 lines · Pavel Machek
Hi!
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
No. The reason is there's no _real_ difference in 'fileserver' and 'webserver' from the PM POV, so this will never happen. There's no reason to introduce different policies for different use cases which however imply similar peripherals utilization. Moreover, I never play MP3s on a fileserver/webserver. The example you've given is pretty much artificial.
Quoted 8 lines
Quoted 2 lines
My notebook has 23 different devices. Do you really want to have 8388608 policies for different perihepal utilizations?
Can you please elaborate on how this number corresponds to the reality? Looks like you don't catch what I'm saying. I'm talking about use case-driven model in which you will need to invent 8388608 use cases basically in order to have 8388608 policies. IOW, not any combination is valid within these 8388608.
I'm saying that usecase-driven model is not acceptable for a kernel. It is not kernel's business to limit user to particular usage models.
That's why your model works for closed machines like a cellphones, but is totally broken for notebook. Sorry.
Quoted 7 lines
Quoted 2 lines
Who talks about kernel? A policy is an userspace thing. I guess we're not quite understanding each other :)
You upload policies to kernel. You want 5 policies for your cellphone, and thats fine, but I'm telling you I'd need 8388608 policies for my notebook, because devices are independent and users want separate control.
No. Users do not, and if they do they won't deal directly with that large of a number of power states.
Do not confuse policies with operating points. The policies define the sets of operating points that are valid at a given time and the policy manager attempts to set the optimum OP.
The user will only deal with the set of policies exported by whatever policy manager is in use. Not the operating points.
power op is attempting to build a power management stack and is near the bottom of the stack.
Quoted 7 lines
Because 8388608 policies is clearly not reasonable, powerop can not help here, and something better should be developed... like power domains someone proposed here.
(Or to say it in another words, powerop forces one big power domain, which is bad model for notebook-style machine).
I doubt notebook-style machines will ever us power op in any significant way. HPC and embedded will be the first users.
Power domains will likely build on top power op.
Power domains adds complexities themselves. Dealing with dependencies and constraints between domains will be a challenge.
It is an interesting thought about implementing powerop interfaces on a per power domain bases....
--mgross
Quoted 7 lines · Mark Gross
Quoted 6 lines · Pavel Machek
Quoted 1 line · Vitaly Wool
On 8/26/06, Pavel Machek <[email protected]> wrote:
Because 8388608 policies is clearly not reasonable, powerop can not help here, and something better should be developed... like power domains someone proposed here.
Quoted 5 lines
Quoted 2 lines
(Or to say it in another words, powerop forces one big power domain, which is bad model for notebook-style machine).
I doubt notebook-style machines will ever us power op in any significant way. HPC and embedded will be the first users.
I agree here... power op look useless for notebooks. But I doubt power op authors would agree...
Quoted 4 lines
Power domains will likely build on top power op.
Power domains adds complexities themselves. Dealing with dependencies and constraints between domains will be a challenge.
Once we have power domains in/solved... do we still need power op? I thought power op could be useful for solving constrains _inside_ one domain, but...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 8 lines · Pavel Machek
Quoted 7 lines · Mark Gross
Quoted 6 lines · Pavel Machek
Quoted 1 line · Vitaly Wool
On 8/26/06, Pavel Machek <[email protected]> wrote:
Because 8388608 policies is clearly not reasonable, powerop can not help here, and something better should be developed... like power domains someone proposed here.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
(Or to say it in another words, powerop forces one big power domain, which is bad model for notebook-style machine).
I doubt notebook-style machines will ever us power op in any significant way. HPC and embedded will be the first users.
I agree here... power op look useless for notebooks. But I doubt power op authors would agree...
Agree that something I work on is useless? Never:) I know I sound like a broken record but...
PowerOP is the basic building block for scaling power management. Its as useless or useful as the cpufreq_driver layer of cpufreq is on laptops. You can think of PowerOP as a redesign of cpufreq_driver that enables other software in the PM stack to select a group of power parameter values by a string. On x86 this other software can continue
to be cpufreq. On embedded devices the other software can use the
powerop sysfs api or kernel APIs.
Quoted 9 lines
Quoted 5 lines
Power domains will likely build on top power op.
Power domains adds complexities themselves. Dealing with dependencies and constraints between domains will be a challenge.
Once we have power domains in/solved... do we still need power op? I thought power op could be useful for solving constrains _inside_ one domain, but...
I don't have a specific answer for this. We will deal with it when we port to hardware that has power domain control.
Quoted 10 lines
Pavel
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ linux-pm mailing list [email protected] https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 8 lines · Pavel Machek
Quoted 7 lines · Mark Gross
Quoted 6 lines · Pavel Machek
Quoted 1 line · Vitaly Wool
On 8/26/06, Pavel Machek <[email protected]> wrote:
Because 8388608 policies is clearly not reasonable, powerop can not help here, and something better should be developed... like power domains someone proposed here.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
(Or to say it in another words, powerop forces one big power domain, which is bad model for notebook-style machine).
I doubt notebook-style machines will ever us power op in any significant way. HPC and embedded will be the first users.
I agree here... power op look useless for notebooks. But I doubt power op authors would agree...
Concluding that it will be useless for notebooks may be premature.
I see powerop as the bottom of an future PM stack. As the upper layers take shape who knows what platforms will use it?
Quoted 9 lines
Quoted 5 lines
Power domains will likely build on top power op.
Power domains adds complexities themselves. Dealing with dependencies and constraints between domains will be a challenge.
Once we have power domains in/solved... do we still need power op? I thought power op could be useful for solving constrains _inside_ one domain, but...
Power domains and the components within them will likely be accessed as operating points. I think we need to build the power domain abstractions on top of operating points. This is why I want to see support for multiple power_op_driver instances or a story for how operating points are added to a running system or even platform to enable and deal with domains.
--mgross
Quoted 15 lines · Mark Gross
Quoted 14 lines · Pavel Machek
Quoted 12 lines · Mark Gross
Quoted 8 lines · Pavel Machek
Quoted 1 line · Vitaly Wool
On 8/26/06, Pavel Machek <[email protected]> wrote:
Because 8388608 policies is clearly not reasonable, powerop can not help here, and something better should be developed... like power domains someone proposed here.
(Or to say it in another words, powerop forces one big power domain, which is bad model for notebook-style machine).
I doubt notebook-style machines will ever us power op in any significant way. HPC and embedded will be the first users.
Quoted 7 lines
Quoted 2 lines
I agree here... power op look useless for notebooks. But I doubt power op authors would agree...
Concluding that it will be useless for notebooks may be premature.
I see powerop as the bottom of an future PM stack. As the upper layers take shape who knows what platforms will use it?
Well, PCs are generaly designed in a way where individual devices are separate, and that means that we do not have linked-parameters-problem powerop tries to solve. But okay, perhaps someone created such notebook in future...
Quoted 9 lines
Quoted 8 lines
Quoted 4 lines
Power domains will likely build on top power op.
Power domains adds complexities themselves. Dealing with dependencies and constraints between domains will be a challenge.
Once we have power domains in/solved... do we still need power op? I thought power op could be useful for solving constrains _inside_ one domain, but...
Quoted 6 lines
Power domains and the components within them will likely be accessed as operating points. I think we need to build the power domain abstractions on top of operating points. This is why I want to see support for multiple
power_op_driverinstances or a story for how operating points are added to a running system or even platform to enable and deal with domains.
Yes, multiple power_op_drivers -- one per power domain -- makes some sense.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 6 lines · ext Pavel Machek
Quoted 6 lines
The userspace interface in Eungeny's patches is for other userspace programs (policy managers) to activate/deactivate valid operating points in the system dynamically and if necessary, introduce new ones into the system. It will also allow the operating points to be referenced by name instead of the tuple.
Quoted 8 lines
Quoted 3 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Switch to 'fast'?
The operating point for a use-case specifies the _minimum_ required for the use-case. You can always go up.
The system designer is responsible for 'designing' operating points that take into account multiple use-cases. Designing here refers to mapping use-cases to HW operating points.
Consider an example system with a main CPU and a DSP. To simplify discussion, lets assume 3 levels for CPU and DSP speeds and system voltage. Then, here is what an example operating-point to use-case mapping table could look like:
# CPU speed DSP speed Voltage use-case
----------------------------------------------------------
1. high high high fast, video 2. med high high 3. med med med usb[1] 4. low med med mp3 5. low low low powersave
[1] USB has voltage constraint (voltage >= med)
Mapping
=======
Performance related: fast, video, mp3
Power related: powersave
Miscellaneous: usb
- Now if we are playing mp3, we switch to OP 4.
- Add usb and we switch to OP 3.
- Now our performance monitor (e.g load avg) indicates that we need more CPU processing. So we switch to OP 2.
Regards,
Amit
Signature · 2 lines
Amit Kucheria <[email protected]> Nokia
Hi!
Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
The userspace interface in Eungeny's patches is for other userspace programs (policy managers) to activate/deactivate valid operating points in the system dynamically and if necessary, introduce new ones into the system. It will also allow the operating points to be referenced by name instead of the tuple.
Quoted 8 lines
Quoted 3 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Quoted 8 lines
Switch to 'fast'?
The operating point for a use-case specifies the _minimum_ required for the use-case. You can always go up.
The system designer is responsible for 'designing' operating points that take into account multiple use-cases. Designing here refers to mapping use-cases to HW operating points.
Yes, and that's why I argue this is unsuitable for notebook: there are just too many usecases for a notebook.
Quoted 7 lines
Consider an example system with a main CPU and a DSP. To simplify discussion, lets assume 3 levels for CPU and DSP speeds and system voltage. Then, here is what an example operating-point to use-case mapping table could look like:
# CPU speed DSP speed Voltage use-case
----------------------------------------------------------
Quoted 7 lines
1. high high high fast, video 2. med high high 3. med med med usb[1] 4. low med med mp3 5. low low low powersave[1] USB has voltage constraint (voltage >= med)
So... you take three independend parametrs and merge them into one, named parameter. Bad idea.
What about simply having these parameters:
usb on or off
cpu speed (controlled by cpufreq)
dsp speed (controlled by userspace)
Then you can have infrastructure that is able to compute system voltage from usb/cpu/dsp speed, and users stll have interface they can understand.
(How are they supposed to know if video use case is compatible with usb? They should not have to).
Quoted 1 line
- Now if we are playing mp3, we switch to OP 4.
Do you expect all mp3 playing applications to play with /sys/.../powerop-point? How do you tell if mp3's are playing? These are hard questions for a notebook.
Quoted 3 lines
- Add usb and we switch to OP 3.
- Now our performance monitor (e.g load avg) indicates that we need more CPU processing. So we switch to OP 2.
That's cpufreq job, please
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 22 lines · ext Pavel Machek
Hi!
Quoted 19 lines
Quoted 6 lines
Quoted 6 lines
The userspace interface in Eungeny's patches is for other userspace programs (policy managers) to activate/deactivate valid operating points in the system dynamically and if necessary, introduce new ones into the system. It will also allow the operating points to be referenced by name instead of the tuple.
Quoted 8 lines
Quoted 3 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Switch to 'fast'?
The operating point for a use-case specifies the _minimum_ required for the use-case. You can always go up.
Quoted 6 lines
Quoted 3 lines
The system designer is responsible for 'designing' operating points that take into account multiple use-cases. Designing here refers to mapping use-cases to HW operating points.
Yes, and that's why I argue this is unsuitable for notebook: there are just too many usecases for a notebook.
You are trying to make it sound more complex than it really is. For a notebook, as you yourself pointed out, things could be handled with the present adaptive, load-based system. So you don't need to map _every_ use-case to an operating point. So you don't need to move to use PowerOP today.
But if someone (distro vendors?) takes the time and effort to map possible use-cases, then the power manager could do better prediction of performance requirements.
Optionally, _if_ applications were power aware, they would send information about their activity to power manager or modify their own class-of-service requirements. e.g. Rendering webpage has different requirements than simply showing the page. This is NOT being discussed at the moment.
But PowerOP would allow SoC-based systems to tune the operating points to get the most out of their top-10 use-cases and sleep modes.
Quoted 13 lines
Quoted 13 lines
Consider an example system with a main CPU and a DSP. To simplify discussion, lets assume 3 levels for CPU and DSP speeds and system voltage. Then, here is what an example operating-point to use-case mapping table could look like:
# CPU speed DSP speed Voltage use-case
----------------------------------------------------------1. high high high fast, video 2. med high high 3. med med med usb[1] 4. low med med mp3 5. low low low powersave
Quoted 4 lines
Quoted 1 line
[1] USB has voltage constraint (voltage >= med)
So... you take three independend parametrs and merge them into one, named parameter. Bad idea.
But they are NOT independent parameters! Which is why we want to encapsulate them into an 'Operating Point'. We have completely failed in our effort to explain the concept of an operating point if that has been your assumption all along.
Quoted 11 lines
What about simply having these parameters:
usb on or off
cpu speed (controlled by cpufreq)
dsp speed (controlled by userspace)
Then you can have infrastructure that is able to compute system voltage from usb/cpu/dsp speed, and users stll have interface they can understand.
This is moot for the reason above - cpu/dsp/volt are NOT independent.
And USB (or any device information) is NOT part of the operating point. It is just an asynchronous constraint whose appearance/disappearance influences operating point tangentially. IOW, on some systems USB could run at any operating point, so there would be no constraint. On others, use of USB would automatically cause usb clocks to go high which in turn would switch the system to an operating point that satisfies the constraint - this is handled by clock/voltage framework.
Quoted 2 lines
(How are they supposed to know if video use case is compatible with usb? They should not have to).
Only one human 'user' needs to worry about this detail - the system designer, and that too only in SoC-based systems. For PC systems, such constraints don't exist; you can be happy with the load-based scaling.
Quoted 5 lines
Quoted 1 line
- Now if we are playing mp3, we switch to OP 4.
Do you expect all mp3 playing applications to play with
/sys/.../powerop-point? How do you tell if mp3's are playing? These are hard questions for a notebook.
There are two ways I can think of:
1. Modify every application - Every application then sends messages to the power manager about its state e.g. paused, playing, ffwd, stopped. This is not meant for PC applications due to their sheer numbers. But it is not uncommon on embedded systems to tune application behaviour to ease/improve power management.
2. Modify central launcher application - Click on an application icon gives us information about what application is about to be launched that allows us to change operating point. This might be doable for PC applications by modifying KDE/Gnome launchers. But it only tells us what applications are loaded, even though they might be idle. Which is where the load average helps.
Quoted 5 lines
Quoted 3 lines
- Add usb and we switch to OP 3.
- Now our performance monitor (e.g load avg) indicates that we need more CPU processing. So we switch to OP 2.That's cpufreq job, please
Yes. Or more particularly, the ondemand governor, right? But load average is not the only input used to make decisions. There could be thermal alarms, battery alarms, etc. And deciding which of these conflicting inputs is given priority is a policy decision made by the device manager. We discussed some of this at the PM summit.
Device manager
|
-------------------------------------
| | | |
Power Performance Thermal Misc.
manager manager manager
(e.g. ondemand) Regards,
Amit
Signature · 2 lines
Amit Kucheria <[email protected]> Nokia
Quoted 27 lines · Amit Kucheria
Quoted 26 lines · ext Pavel Machek
Hi!
Quoted 23 lines
Quoted 6 lines
Quoted 6 lines
The userspace interface in Eungeny's patches is for other userspace programs (policy managers) to activate/deactivate valid operating points in the system dynamically and if necessary, introduce new ones into the system. It will also allow the operating points to be referenced by name instead of the tuple.
Quoted 8 lines
Quoted 3 lines
Then, we will be able to use names like 'video', 'mp3', 'fast', 'powersave', 'usb' to switch to the relevant operating point based on configuration of the policy manager.
This seems to be too specific to embedded machine.
If userspace wants to work with usb and play mp3s at the same time, what does it do?
Switch to 'fast'?
The operating point for a use-case specifies the _minimum_ required for the use-case. You can always go up.
The system designer is responsible for 'designing' operating points that take into account multiple use-cases. Designing here refers to mapping use-cases to HW operating points.
Quoted 8 lines
Quoted 2 lines
Yes, and that's why I argue this is unsuitable for notebook: there are just too many usecases for a notebook.
You are trying to make it sound more complex than it really is. For a notebook, as you yourself pointed out, things could be handled with the present adaptive, load-based system. So you don't need to map _every_ use-case to an operating point. So you don't need to move to use PowerOP today.
Ok, but please do not try to replace cpufreq with
powerop/oppoint. That is not possible.
Quoted 2 lines
But PowerOP would allow SoC-based systems to tune the operating points to get the most out of their top-10 use-cases and sleep modes.
Question is: can we get similar savings without ugly interface powerop presents?
Quoted 15 lines
Quoted 15 lines
Quoted 14 lines
Consider an example system with a main CPU and a DSP. To simplify discussion, lets assume 3 levels for CPU and DSP speeds and system voltage. Then, here is what an example operating-point to use-case mapping table could look like:
# CPU speed DSP speed Voltage use-case
----------------------------------------------------------1. high high high fast, video 2. med high high 3. med med med usb[1] 4. low med med mp3 5. low low low powersave[1] USB has voltage constraint (voltage >= med)
Quoted 7 lines
Quoted 2 lines
So... you take three independend parametrs and merge them into one, named parameter. Bad idea.
But they are NOT independent parameters! Which is why we want to encapsulate them into an 'Operating Point'. We have completely failed in our effort to explain the concept of an operating point if that has been your assumption all along.
They are independed, at least from application point of view. And that's probably right interface to present to userland. Application tells you its dsp speed desired, you take current cpu frequency requirements from cpufreq, and select ooperating point with lowest consumption based on that constraints.
Quoted 14 lines
Quoted 11 lines
What about simply having these parameters:
usb on or off
cpu speed (controlled by cpufreq)
dsp speed (controlled by userspace)
Then you can have infrastructure that is able to compute system voltage from usb/cpu/dsp speed, and users stll have interface they can understand.
This is moot for the reason above - cpu/dsp/volt are NOT independent.
Quoted 7 lines
And USB (or any device information) is NOT part of the operating point. It is just an asynchronous constraint whose appearance/disappearance influences operating point tangentially. IOW, on some systems USB could run at any operating point, so there would be no constraint. On others, use of USB would automatically cause usb clocks to go high which in turn would switch the system to an operating point that satisfies the constraint - this is handled by clock/voltage framework.
Okay, and why can't we handle _all_ the constraints in this style? Ask userspace what constraints are there, and automagically select best operating point, without having operating points explicit at userspace interface.
Quoted 11 lines
Quoted 5 lines
Quoted 3 lines
- Add usb and we switch to OP 3.
- Now our performance monitor (e.g load avg) indicates that we need more CPU processing. So we switch to OP 2.That's cpufreq job, please
Yes. Or more particularly, the ondemand governor, right? But load average is not the only input used to make decisions. There could be thermal alarms, battery alarms, etc. And deciding which of these conflicting inputs is given priority is a policy decision made by the device manager. We discussed some of this at the PM summit.
cpufreq already knows about thermal. (There's no policy in there, you can't allow system to overheat).
cpufreq already knows about battery. (On some powernow-k8, high cpu frequencies are not available on battery power, because battery is not powerful enough). If you have aditional constraints (may not use 400MHz when battery is below 20%, because li-ion has too big internal resistancy at that point?), please use cpufreq framework to enforce them.
Is there anything cpufreq can't do?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 1 line · ext Pavel Machek
On Wed 2006-08-30 14:00:53, Amit Kucheria wrote:
<snip>
Quoted 8 lines
Quoted 5 lines
You are trying to make it sound more complex than it really is. For a notebook, as you yourself pointed out, things could be handled with the present adaptive, load-based system. So you don't need to map _every_ use-case to an operating point. So you don't need to move to use PowerOP today.
Ok, but please do not try to replace cpufreq with
powerop/oppoint. That is not possible.
No one wants to replace cpufreq with PowerOP today. Which is why the patches make PowerOP optional. But embedded systems need it today.
Quoted 6 lines
Quoted 2 lines
But PowerOP would allow SoC-based systems to tune the operating points to get the most out of their top-10 use-cases and sleep modes.
Question is: can we get similar savings without ugly interface powerop presents?
If I have understood correctly, your main objection is to defining new operating points from userspace?
The only other interface is the actually setting of a (named) operating point and that is _required_ to do anything useful.
<snip>
Quoted 10 lines
Quoted 4 lines
But they are NOT independent parameters! Which is why we want to encapsulate them into an 'Operating Point'. We have completely failed in our effort to explain the concept of an operating point if that has been your assumption all along.
They are independed, at least from application point of view. And that's probably right interface to present to userland. Application tells you its dsp speed desired, you take current cpu frequency requirements from cpufreq, and select ooperating point with lowest consumption based on that constraints.
You are violating your own principles here - why should application know about 'DSP speed'?
And individual applications don't know about operating points either. They just present their requirements in terms of increased load or a constraint (usb, temp, etc.). The device manager gets inputs about this increased load and constraints and programs the appropriate OP. So we agree here.
<snip>
Quoted 8 lines
Quoted 7 lines
And USB (or any device information) is NOT part of the operating point. It is just an asynchronous constraint whose appearance/disappearance influences operating point tangentially. IOW, on some systems USB could run at any operating point, so there would be no constraint. On others, use of USB would automatically cause usb clocks to go high which in turn would switch the system to an operating point that satisfies the constraint - this is handled by clock/voltage framework.
Quoted 5 lines
Okay, and why can't we handle _all_ the constraints in this style? Ask userspace what constraints are there, and automagically select best operating point, without having operating points explicit at userspace interface.
OP change _will_ happen automatically in the kernel for quick transitions. But the device manager will sometimes override this with policy decisions. Because in certain cases, userspace knows best.
<snip>
Quoted 9 lines
Quoted 5 lines
Yes. Or more particularly, the ondemand governor, right? But load average is not the only input used to make decisions. There could be thermal alarms, battery alarms, etc. And deciding which of these conflicting inputs is given priority is a policy decision made by the device manager. We discussed some of this at the PM summit.
cpufreq already knows about thermal. (There's no policy in there, you can't allow system to overheat).
Quoted 6 lines
cpufreq already knows about battery. (On some powernow-k8, high cpu frequencies are not available on battery power, because battery is not powerful enough). If you have aditional constraints (may not use 400MHz when battery is below 20%, because li-ion has too big internal resistancy at that point?), please use cpufreq framework to enforce them.
I will look at support for thermal/battery events in cpufreq in greater detail.
Quoted 1 line
Is there anything cpufreq can't do?
- Embedded systems _want_ to deal with performance/power management in terms of Operating Points that encapsulate the complete state of the SoC (core speeds, voltages, buses speeds, etc.) instead of only CPU frequency.
- There is not much in cpufreq for handling rate propagation and dependency tracking for clocks and voltages. This is what the clock framework and the upcoming voltage framework handle quite well.
- Most implementations of cpufreq drivers have a fixed rate table (freq, voltage). With rate propagation and dependencies in SoCs, available rates can vary dynamically based on states of various cores, peripherals, etc.
Regards,
Amit
Signature · 2 lines
Amit Kucheria <[email protected]> Nokia
Hi!
Quoted 10 lines · Amit Kucheria
Quoted 6 lines · ext Pavel Machek
Quoted 2 lines · Amit Kucheria
But PowerOP would allow SoC-based systems to tune the operating points to get the most out of their top-10 use-cases and sleep modes.
Question is: can we get similar savings without ugly interface powerop presents?
If I have understood correctly, your main objection is to defining new operating points from userspace?
Well, that is big objection, but not my main one. I believe that "new operating points from userspace" are non-starter. "So obviously wrong that noone would merge that".
Quoted 2 lines
The only other interface is the actually setting of a (named) operating point and that is _required_ to do anything useful.
No, they are not.
We already have interface for selecting cpu frequency. Lets keep it.
We may need new interface for selecting DSP frequency. If that is needed, lets *add* that interface.
We may need new interface to say if usb needs to be enabled or not. How to do that interface right is a question, but lets say we *add* that interface.
Now, it should be up-to the powerop framework to select best operating point given "cpu speed, dsp speed, usb on/off" state. But I argue that this should be done in-kernel and hidden from user.
Quoted 6 lines
Quoted 1 line
Is there anything cpufreq can't do?
- Embedded systems _want_ to deal with performance/power management in terms of Operating Points that encapsulate the complete state of the SoC (core speeds, voltages, buses speeds, etc.) instead of only CPU frequency.
I'm not saying we'll not have complete-SoC-state at some layer. But I do not think we want it at userspace-kernelspace interface.
Quoted 3 lines
- There is not much in cpufreq for handling rate propagation and dependency tracking for clocks and voltages. This is what the clock framework and the upcoming voltage framework handle quite well.
Good.
Quoted 4 lines
- Most implementations of cpufreq drivers have a fixed rate table (freq, voltage). With rate propagation and dependencies in SoCs, available rates can vary dynamically based on states of various cores, peripherals, etc.
But that's cpufreq-implementation-detail, right?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Hi!
Quoted 3 lines
5. <Crystal Ball Gazing/Wishful Thinking>
- Clock/Voltage FW <--> ACPI logical mappings allows us to use global state names in/sys/power/statefor system power state transitions.
We probably do not want cpufreq-like controls in /sys/power/state.
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 6 lines · Greg KH
Quoted 5 lines · Dave Jones
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of view, what does adding this buy us? What problem do we have today that is being solved by all this?
Greg and Dave,
there are two competing patch sets for a new power management
framework. The patch set I sent out simplifies power management,
from both the cpufreq perspective and the embedded world's view of power management.
I've renamed my patch oppoint so as not confuse it
with the powerop set from Matt Locke (which will probably make it even more confusing). I've renamed it so it can be seen as an alternative design approach, not just an alternative implementation of the same ideas. I've also incorporated suggestions from Pavel in cleaning up the original patches.
If you'd be willing to take a look at, or try out, the patches
in my patch set you should be able to see how oppoint could simplify cpufreq code. The first patch is the oppoint-cpufreq.patch and the second is the oppoint-x86-centrino.patch.
Oppoint could replace large pieces of the cpufreq code
in the kernel, most notably the policy and governor code, which I believe belongs in user space in the power manager daemon.
You'll notice that the oppoint-cpufreq.patch only touches
two files, cpufreq.c and cpufreq.h. It only creates two new interfaces to the cpufreq frequency scaling notifier lists to support driver pre and post scaling routines, already supported in the kernel.
The oppoint-x86-centrino.patch completes the replacement
of cpufreq code by introducing the transition routine to change frequencies and creates operating points for the centrino-speedstep processors already supported by Linux.
(although I've recieved a note from Intel that the data I've copied from the centrino-speedstep cpufreq tables is known to be inaccurate and unsupported)
This code could replace cpufreq code and simplify it quite a
bit in the process. The kernel drivers that support cpufreq frequency scaling would not have to be changed. Operating points for the rest of the processors that support cpufreq would have to be created, but as you can see it's quite a straight forward transformation from a cpufreq table to a set of operating points for a processor.
The entire patch set can be found at:
http://source.mvista.com/~dsingleton/2.6.18-rc4/
The patch set consists of:
oppoint-core.patch
oppoint-cpufreq.patch
oppoint-x86-centrino.patch
oppoint-arm-pxa27x.patch
I'll attach oppoint-cpufreq.patch to this email and send out oppoint-x86-centrino.patch next.
David
Quoted 17 lines
Quoted 11 lines
Every explanation of powerop I've seen so far dives into microdetails, whilst the 10,000ft view has always passed me by other than "this is what we've had in the embedded world".
The diagram at http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html
also confuses me. I was under the impression that powerop was adding additional userspace interfaces. If we're not changing how things from a userspace point of view, we're churning a lot of kernel code,.. why?Clue me in here, I'm feeling thick.
You're not alone, I really don't get it either.
But I guess we'll just wait for the next round of unified patches and then go from there.
Quoted 8 lines
thanks,
greg k-h
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
drivers/cpufreq/cpufreq.c | 36 ++++++++++++++++++++++++++++++++++++ include/linux/cpufreq.h | 2 ++ 2 files changed, 38 insertions(+)
drivers/cpufreq/cpufreq.c +36 -0
@@ -226,6 +226,35 @@ static void adjust_jiffies(unsigned longstatic inline void adjust_jiffies (unsigned long val,struct cpufreq_freqs *ci) {return ; }#endif +int cpufreq_prepare_transition (struct oppoint *cur,struct oppoint *new) +{ +struct cpufreq_freqs freqs; + + freqs.old = cur->frequency; + freqs.new = new->frequency; + freqs.cpu =0 ; + freqs.flags = cpufreq_driver->flags; +blocking_notifier_call_chain (&cpufreq_transition_notifier_list, +CPUFREQ_PRECHANGE , &freqs); +adjust_jiffies (CPUFREQ_PRECHANGE , &freqs); +return 0 ; +} +EXPORT_SYMBOL (cpufreq_prepare_transition); + +int cpufreq_finish_transition (struct oppoint *cur,struct oppoint *new) +{ +struct cpufreq_freqs freqs; + + freqs.old = cur->frequency; + freqs.new = new->frequency; + freqs.cpu =0 ; + freqs.flags = cpufreq_driver->flags; +adjust_jiffies (CPUFREQ_POSTCHANGE , &freqs); +blocking_notifier_call_chain (&cpufreq_transition_notifier_list, +CPUFREQ_POSTCHANGE , &freqs); +return 0 ; +} +EXPORT_SYMBOL (cpufreq_finish_transition);/** * cpufreq_notify_transition - call notifier chain and adjust_jiffies
@@ -920,6 +949,12 @@ static void cpufreq_out_of_sync(unsigned } +#ifdef CONFIG_PM +unsigned int cpufreq_quick_get (unsigned int cpu) +{ +return (current_state->frequency *1000 ); +} +#else /** * cpufreq_quick_get - get the CPU frequency (in kHz) frpm policy->cur * @cpu: CPU number
@@ -941,6 +976,7 @@ unsigned int cpufreq_quick_get(unsigned return (ret); } +#endif EXPORT_SYMBOL (cpufreq_quick_get);
include/linux/cpufreq.h +2 -0
@@ -268,6 +268,8 @@ static inline unsigned int cpufreq_quick return 0; }#endif +int cpufreq_prepare_transition (struct oppoint *cur,struct oppoint *new); +int cpufreq_finish_transition (struct oppoint *cur,struct oppoint *new);/*********************************************************************
Quoted 19 lines · David Singleton
Oppoint could replace large pieces of the cpufreq code
in the kernel, most notably the policy and governor code, which I believe belongs in user space in the power manager daemon.You'll notice that the oppoint-cpufreq.patch only touches
two files,cpufreq.candcpufreq.h. It only creates two new interfaces
to the cpufreq frequency scaling notifier lists to support driver pre and post scaling routines, already supported in the kernel.The oppoint-x86-centrino.patch completes the replacement
of cpufreq code by introducing the transition routine to change frequencies and creates operating points for the centrino-speedstep processors already supported by Linux.(although I've recieved a note from Intel that the data I've copied from the centrino-speedstep cpufreq tables is known to be inaccurate and unsupported)
Quoted 7 lines
This code could replace cpufreq code and simplify it quite a
bit in the process. The kernel drivers that support cpufreq frequency
scaling would not have to be changed. Operating points for the rest of the processors that support cpufreq would have to be created, but as you can see it's quite a straight forward transformation from a cpufreq table to a set of operating points for a processor.
This only touches on the cpu frequency stuff. I am assuming that the current driver interface to the different power management states is acceptable to you?
thanks,
greg k-h
Quoted 28 lines · Greg KH
Quoted 19 lines · David Singleton
Oppoint could replace large pieces of the cpufreq code
in the kernel, most notably the policy and governor code, which I believe belongs in user space in the power manager daemon.You'll notice that the oppoint-cpufreq.patch only touches
two files,cpufreq.candcpufreq.h. It only creates two new interfaces
to the cpufreq frequency scaling notifier lists to support driver pre and post scaling routines, already supported in the kernel.The oppoint-x86-centrino.patch completes the replacement
of cpufreq code by introducing the transition routine to change frequencies and creates operating points for the centrino-speedstep processors already supported by Linux.(although I've recieved a note from Intel that the data I've copied from the centrino-speedstep cpufreq tables is known to be inaccurate and unsupported)
Quoted 7 lines
This code could replace cpufreq code and simplify it quite a
bit in the process. The kernel drivers that support cpufreq frequency
scaling would not have to be changed. Operating points for the rest of the processors that support cpufreq would have to be created, but as you can see it's quite a straight forward transformation from a cpufreq table to a set of operating points for a processor.
Quoted 3 lines
This only touches on the cpu frequency stuff. I am assuming that the current driver interface to the different power management states is acceptable to you?
Yes. The driver interface works perfectlly with the operating point design.
The power manager can simply set whatever operating point it wants the system to be in and still have the flexibility to suspend individual devices through the current driver interface. Drivers do not have be changed in any way to operate correctly with the operating point model.
The cpufreq driver scaling code doesn't need to changed either. OpPoint
calls the same scaling routines throught the same notifier chain as cpufreq does.
That's two of the big advantages to the OpPoint design,
the driver interace doesn't need to change and the existing driver frequency scaling code doesn't need to change either.
Which makes sense since the operating point design is performing the same
functionality, just in a simpler manner.
I still have to write a power manager for this so all the
policy/class stuff
that's being discussed now can be plug-ins for the power manager. You'd set you power management classes and policies up in the power manager, wether its' performance, or energy efficiency, or thermal constraints, or battery
constraints, and let it simply set operating states and handle individual devices
as it sees fit.
That's really where all the policy/class code belongs, in the
power manager.
OpPoint just provides a simpler interface for the power manager. The operating points are set by their name and the device control works just as it does today through the sysfs interface.
David
Quoted 5 lines
thanks,
greg k-h
Quoted 9 lines · David Singleton
Quoted 7 lines · Greg KH
Quoted 3 lines · Dave Jones
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of
view,
Quoted 2 lines
what does adding this buy us? What problem do we have today that is being solved by all this?
Quoted 7 lines
Greg and Dave,
there are two competing patch sets for a new power management
framework. The patch set I sent out simplifies power management,
from both the cpufreq perspective and the embedded world's view of power management.
Why can't we have one evolve a single powerOP framework? Both of these patches are derived from The MV/Todd Poynor's patches. It seems "funny" to not coordinate these two patch sets.
Quoted 8 lines
I've renamed my patch oppoint so as not confuse it
with the powerop set from Matt Locke (which will probably make it even more confusing). I've renamed it so it can be seen as an alternative design approach, not just an alternative implementation of the same ideas. I've also incorporated suggestions from Pavel in cleaning up the original patches.
Quoted 5 lines
If you'd be willing to take a look at, or try out, the patches
in my patch set you should be able to see how oppoint could simplify cpufreq code. The first patch is the oppoint-cpufreq.patch and the second is the oppoint-x86-centrino.patch.
How would the ACPI cpufreq_driver be integrated with this design?
Quoted 4 lines
Oppoint could replace large pieces of the cpufreq code
in the kernel, most notably the policy and governor code, which I believe belongs in user space in the power manager daemon.
How will the users of on-demand make use of this design? I don't think you can just dump the governor function of CPUFREQ for user defined performance control.
Quoted 6 lines
You'll notice that the oppoint-cpufreq.patch only touches
two files,cpufreq.candcpufreq.h. It only creates two new interfaces
to the cpufreq frequency scaling notifier lists to support driver pre and post scaling routines, already supported in the kernel.
re-using the cpufreq notification infrastructure makes sense.
Quoted 5 lines
The oppoint-x86-centrino.patch completes the replacement
of cpufreq code by introducing the transition routine to change frequencies and creates operating points for the centrino-speedstep processors already supported by Linux.
Quoted 7 lines
(although I've recieved a note from Intel that the data I've copied from the centrino-speedstep cpufreq tables is known to be inaccurate and unsupported)
This code could replace cpufreq code and simplify it quite a
bit in the process. The kernel drivers that support cpufreq frequency
Only for user mode governors, I believe kernel mode governors still have role in Linux.
--mgross
Quoted 57 lines
scaling would not have to be changed. Operating points for the rest of the processors that support cpufreq would have to be created, but as you can see it's quite a straight forward transformation from a cpufreq table to a set of operating points for a processor.
The entire patch set can be found at:
http://source.mvista.com/~dsingleton/2.6.18-rc4/
The patch set consists of:
oppoint-core.patch
oppoint-cpufreq.patch
oppoint-x86-centrino.patch
oppoint-arm-pxa27x.patchI'll attach oppoint-cpufreq.patch to this email and send out oppoint-x86-centrino.patch next.
David
Quoted 19 lines
Quoted 6 lines
Every explanation of powerop I've seen so far dives into microdetails, whilst the 10,000ft view has always passed me by other than "this is what we've had in the embedded world".
The diagram at
http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html
Quoted 1 line
also confuses me. I was under the impression that powerop was adding
additional
Quoted 4 lines
userspace interfaces. If we're not changing how things from a userspace point of view, we're churning a lot of kernel code,.. why?
Clue me in here, I'm feeling thick.
You're not alone, I really don't get it either.
But I guess we'll just wait for the next round of unified patches and then go from there.
Quoted 8 lines
thanks,
greg k-h
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
Hi!
Quoted 27 lines
Quoted 5 lines
Quoted 2 lines
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of
view,
Quoted 2 lines
what does adding this buy us? What problem do we have today that is being solved by all this?
Greg and Dave,
there are two competing patch sets for a new power management
framework. The patch set I sent out simplifies power management,
from both the cpufreq perspective and the embedded world's view of power management.I've renamed my patch oppoint so as not confuse it
with the powerop set from Matt Locke (which will probably make it even more confusing). I've renamed it so it can be seen as an alternative design approach, not just an alternative implementation of the same ideas. I've also incorporated suggestions from Pavel in cleaning up the original patches.If you'd be willing to take a look at, or try out, the patches
in my patch set you should be able to see how oppoint could simplify cpufreq code. The first patch is the oppoint-cpufreq.patch and the second is the oppoint-x86-centrino.patch.
Quoted 3 lines
Oppoint could replace large pieces of the cpufreq code
in the kernel, most notably the policy and governor code, which I believe belongs in user space in the power manager daemon.
I was told (by intel folks) that you can't push governor code into userspace, because it is latency-critical on new cpus... so I do not think this is going to simplify cpufreq.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 6 lines · Greg KH
Quoted 5 lines · Dave Jones
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of view, what does adding this buy us? What problem do we have today that is being solved by all this?
Greg and Dave,
Here is the patch the provides the cpufreq functionality in an
operating point
fashion for the centrino-speedstep. Cpufreq tables are transformed
into operating
points which can be simply set by writing the name of the operating point into /sys/power/state.
These two patches implement the cpufreq functionality of changing
processsor
frequency and voltage. The huge amount of code that tries to make decisions about what operating point to set and which devices can be suspended or not is left to
the power manager.
David
Quoted 17 lines
Quoted 11 lines
Every explanation of powerop I've seen so far dives into microdetails, whilst the 10,000ft view has always passed me by other than "this is what we've had in the embedded world".
The diagram at http://lists.osdl.org/pipermail/linux-pm/2006-August/003196.html
also confuses me. I was under the impression that powerop was adding additional userspace interfaces. If we're not changing how things from a userspace point of view, we're churning a lot of kernel code,.. why?Clue me in here, I'm feeling thick.
You're not alone, I really don't get it either.
But I guess we'll just wait for the next round of unified patches and then go from there.
Quoted 8 lines
thanks,
greg k-h
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
arch/i386/kernel/cpu/Makefile | 1 arch/i386/kernel/cpu/oppoint/Makefile | 2 arch/i386/kernel/cpu/oppoint/centrino-dynamic-oppoint.c | 71 ++ arch/i386/kernel/cpu/oppoint/centrino-oppoint.c | 460 ++++++++++++++++ arch/i386/kernel/i386_ksyms.c | 4 5 files changed, 538 insertions(+)
arch/i386/kernel/cpu/Makefile +1 -0
@@ -17,3 +17,4 @@ obj-$(CONFIG_X86_MCE) += mcheck/ obj-$(CONFIG_MTRR) += mtrr/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ +obj-$(CONFIG_PM) += oppoint/
arch/i386/kernel/i386_ksyms.c +4 -0
@@ -28,3 +28,7 @@ EXPORT_SYMBOL(__read_lock_failed);#endif EXPORT_SYMBOL (csum_partial); +#ifdef CONFIG_PM +#include <linux/pm.h> +EXPORT_SYMBOL (pm_states); +#endif
arch/i386/kernel/cpu/oppoint/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += centrino-oppoint.o +obj-m += centrino-dynamic-oppoint.o
arch/i386/kernel/cpu/oppoint/centrino-dynamic-oppoint.c new file +71 -0
71 lines not on this page · raw message
arch/i386/kernel/cpu/oppoint/centrino-oppoint.c new file +460 -0
460 lines not on this page · raw message
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 26 lines · Dave Jones
Quoted 18 lines · David Singleton
Quoted 6 lines · Greg KH
Quoted 5 lines · Dave Jones
This adds a whole bunch of new code, and doesn't seem to make any existing code any simpler (to me at least). From a cpufreq point of view, what does adding this buy us? What problem do we have today that is being solved by all this?
Greg and Dave,
Here is the patch the provides the cpufreq functionality in an
operating point
fashion for the centrino-speedstep. Cpufreq tables are transformed
into operating
points which can be simply set by writing the name of the operating point into/sys/power/state.Quoted 6 lines
These two patches implement the cpufreq functionality of changing
processsor
frequency and voltage. The huge amount of code that tries to make decisions about what operating point to set and which devices can be suspended or not is left to
the power manager.
Quoted 5 lines
Why does this replicate the cpufreq driver instead of just *using* it ? From a distro vendor standpoint, I want to offer people choice, which means with this patch we'd have both drivers compiled in, but this now means we have two sets of tables to add to every time we have new cpu support to add. Two places to look for implementation bugs etc etc.
Dave,
I didn't use the cpufreq driver because I couldn't.
While encapsulated operating points can do CPU frequency scaling they also do a bit more.
If you take a look at the 4th patch in the patch set,
the oppoint-arm-pxa27x.patch, it shows that an operating point encapsulates a lot more system state than just the CPU.
There are a set of clocks that have to managed and scaled
when CPU frequency is scaled. The arm-pxa27x patch also shows that this board has larger operating points but still uses the cpufreq driver scaling functions, with out any change to existing drivers.
The operating point model performs the needed driver
preparation and finishing routines to CPU and clock scaling by using the cpufreq driver scaling callbacks in the cpufreq notifier chain.
The next three boards I'm working on have expanded
system state encapsulated in their operating points. They have separately controllable power domains and they can run operating points at the same CPU frequency but at a lower voltage. For example, one operating point runs at 168Mhz and 1.5V and another operating point runs at 168Mhz and 1.1V.
While OpPoint can perform the same functionality as
cpufreq, without the extra overhead and complexity of policies and governors, it provides a framework that can handle much more system state control, separate power domains, individually scalable clocks, both frequency and voltage scaling and sleep states.
The next three boards also have more than one sleep
state.
I like the cpufreq concept of defining the operating
points at compile time and letting the system discover which
CPU and operating points to install at boot time. But I needed
a bit more system state control than the cpufreq driver can provide.
If I had all the existing cpufreq tables transformed
into operating points I could make a patch that would remove the bulk of cpufreq code from the kernel and you'd have pretty much the same functionality without the maintenance issues the added layers and complexity bring.
The aim of this patch set is to unify cpufreq with the Dynamic
Power Management infrastructure, which deals with complex system state and individual power domains, and clock domains, etc. If merged, there would just be one power management framework that all architectures and platforms could use.
David
Quoted 5 lines
Quoted 5 lines · David Singleton
If I had all the existing cpufreq tables transformed into operating points I could make a patch that would remove the bulk of cpufreq code from the kernel and you'd have pretty much the same functionality without the maintenance issues the added layers and complexity bring.
If this is going to fly at all, I think thats where we need to be headed. Having two parts of the kernel doing the same thing just seems very wrong to me.
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
Dave
Signature · 1 line
http://www.codemonkey.org.uk
Quoted 12 lines · Dave Jones
Quoted 5 lines · David Singleton
If I had all the existing cpufreq tables transformed into operating points I could make a patch that would remove the bulk of cpufreq code from the kernel and you'd have pretty much the same functionality without the maintenance issues the added layers and complexity bring.
If this is going to fly at all, I think thats where we need to be headed. Having two parts of the kernel doing the same thing just seems very wrong to me.
Quoted 7 lines
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
I worry about all the users of ondemand and powernow. Whatever happens it needs to be a evolve over time. I don't know how you can have only one power solution that works for HPC and embedded.
Quoted 9 lines
Dave
Signature · 5 lines
http://www.codemonkey.org.uk _______________________________________________ linux-pm mailing list [email protected] https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 12 lines · Dave Jones
Quoted 5 lines · David Singleton
If I had all the existing cpufreq tables transformed into operating points I could make a patch that would remove the bulk of cpufreq code from the kernel and you'd have pretty much the same functionality without the maintenance issues the added layers and complexity bring.
If this is going to fly at all, I think thats where we need to be headed. Having two parts of the kernel doing the same thing just seems very wrong to me.
Quoted 7 lines
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
This week I got some really good feedback and suggestions from Mark Gross on the kernel interface and usability and I have two new additions for this patch set. So I spend the week working on a well thought out kernel interface.
1) I believe I now have the right kernel interface for a common power management infrastructure.
The new kernel interface still uses /sys/power/state to both show the current operating point and set a desired operating point, by name. There is a new /sys/power/operating_points directory that shows all the operating points the system supports. An exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standby
In each operating point directory there are three files, frequency, voltage and latency. They show the frequency, voltage and transition latency respectively for the operating point. An example from my centrino laptop shows:
/sys/power/operating_points/high/frequency /sys/power/operating_points/high/voltage /sys/power/operating_points/high/latency
I've finally had a bit of time to get the sysfs one file - one value system in place for OpPoint.
2) The really good news is there is a now a power manager for
OpPoint now,
both in rpm and src rpm form. And since the new power manager runs off the new kernel interface and actually does what the cpuspeed daemon does I think the kernel interface is sound.
I took the cpuspeed power manager daemon, version 1.2.1, and modified it Friday to use the oppoint interface. It supports all the options the cpuspeed daemon does, (and can actually still be compiled to be the original cpuspeed daemon) it just uses the interface described above instead of the cpufreq interfaces.
For anyone out there with a centrino laptop there is now a complete solution for oppoint power management. To try the solution you'll only have to add three patches to the 2.6.18-rc4 kernel and install the oppointd rpm.
The patches you'll need are:
oppoint-core.patch
oppoint-cpufreq.patch
oppoint-x86-centrino.patch
The oppointd rpm installs these files on your system:
/etc/sysconfig/oppoint-powermanagement /etc/init.d/oppointd /usr/sbin/oppointd /usr/local/man/man.1/oppointd
"/etc/init.d/oppoint start" turns on the daemon and off it goes. The default configuration uses the system load as an indicator or operating point to run. The more idle the system is the lower the operating point. When the system is unused it quickly drops to the lowest operating point. It's the power management policy I like to use for my laptop.
Within 2 seconds the system drops into the lowest state if the machine is comletely idle, and up to the highest state within two seconds when I start off a kernel build.
The default configuration also uses the acpi AC adapter state. When the AC adapter is not plugged the system goes into the low state.
I have a patch for the AMD elan processor line and the
powernow-k6 processors,
but I don't have any hardware to test them on. If anyone would be willing to help me test the elan, powernow-k6 (and soon the powernow-k7) patches I'd really appreciate it.
The patchset and rpmsl are available at:
http://source.mvista.com/~dsingleton
There is one last thing I'd like to point out. This interface can support all the thousands of power management policy combinations being discussed. It can support each operating state the system can support and all the combinations of each state and a set of devices on the system being suspended or not. And none of the power management policies need to be in the kernel to be supported.
For example, this interface will support a power management policy so the system can run at the medium state to run an mp3 player and suspend the lcd and usb controller, or leave the usb controller on if its being used.
The thousands of combinations of possible power management policies belong in the power manager, which can be much more easily tailored to the individual platfrom, whether server, laptop or handheld.
David
Quoted 6 lines
Dave
Hi!
Quoted 22 lines
Quoted 7 lines
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
This week I got some really good feedback and suggestions from Mark Gross on the kernel interface and usability and I have two new additions for this patch set. So I spend the week working on a well thought out kernel interface.
1) I believe I now have the right kernel interface for a common power management infrastructure.
The new kernel interface still uses
/sys/power/stateto both show the current operating point and set a desired operating point, by name. There is a new/sys/power/operating_pointsdirectory that shows all the operating points the system supports. An exampled from my centrino laptop shows:
Quoted 7 lines
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standby
What makes you think that mixing operating and sleep states is good idea?
And '600MHz' makes lot more sense than 'lowest' on centrino.
Quoted 3 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latency
What is voltage for 'mem'?
Quoted 9 lines
I've finally had a bit of time to get the sysfs one file - one value system in place for OpPoint.
2) The really good news is there is a now a power manager for
OpPoint now,
both in rpm and src rpm form. And since the new power manager runs off the new kernel interface and actually does what the cpuspeed daemon does I think the kernel interface is sound.
Quoted 5 lines
I took the cpuspeed power manager daemon, version 1.2.1, and modified it Friday to use the oppoint interface. It supports all the options the cpuspeed daemon does, (and can actually still be compiled to be the original cpuspeed daemon) it just uses the interface described above instead of the cpufreq interfaces.
Congratulations, you now have inferior version of cpufreq ondemand governor.
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 32 lines · Pavel Machek
Hi!
Quoted 22 lines
Quoted 7 lines
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
This week I got some really good feedback and suggestions from Mark Gross on the kernel interface and usability and I have two new additions for this patch set. So I spend the week working on a well thought out kernel interface.
1) I believe I now have the right kernel interface for a common power management infrastructure.
The new kernel interface still uses
/sys/power/stateto both show the current operating point and set a desired operating point, by name. There is a new/sys/power/operating_pointsdirectory that shows all the operating points the system supports. An exampled from my centrino laptop shows:Quoted 7 lines
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standby
Quoted 2 lines
What makes you think that mixing operating and sleep states is good idea?
They are all power states managed by the kernel and in the operating point concept they are all operating points the system supports.
The system can be set to any of the supported states by setting their name in the /sys/power/state file. I find simplicity is usually a good thing.
Quoted 2 lines
And '600MHz' makes lot more sense than 'lowest' on centrino.
Perhaps, but the common name space makes it easy for the power manager daemon to perform the same functions without having to know that the lowest speed on my laptop is 600Mhz.
I have the same power manager running on my laptop as on my ARM pxa27x board and it's performing the same operations, even though there are different frequencies behind the name "lowest".
The frequency is available in the /sys/power/operating_points/lowest/frequency file, which the power manager reads when it starts up.
Quoted 6 lines
Quoted 4 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latencyWhat is voltage for 'mem'?
I don't know what the voltage or latency is for mem. Perhaps Intel could better say what the voltage is in the suspend state and what the latency was for transistion to that state. I didn't have the data available when I wrote the code.
Quoted 10 lines
Quoted 10 lines
I've finally had a bit of time to get the sysfs one file - one value system in place for OpPoint.
2) The really good news is there is a now a power manager for
OpPoint now,
both in rpm and src rpm form. And since the new power manager runs off the new kernel interface and actually does what the cpuspeed daemon does I think the kernel interface is sound.
Quoted 8 lines
Quoted 5 lines
I took the cpuspeed power manager daemon, version 1.2.1, and modified it Friday to use the oppoint interface. It supports all the options the cpuspeed daemon does, (and can actually still be compiled to be the original cpuspeed daemon) it just uses the interface described above instead of the cpufreq interfaces.
Congratulations, you now have inferior version of cpufreq ondemand governor.
Perhaps inferior, but definitely simpler, and its outside of the kernel.
And it's able to also work on a wider range of system power states than just scaling
frequency. The PXA27x controls a lot more clock state than a centino or powernow
system. The next set of systems I'm working on have separate power domains that
are individually controllable out side of the processor speed and they fit nicely within
the same framework and can work with the same power manager daemon.
A single power management infrastructure for the kernel would not be an inferior nor a bad thing.
David
Quoted 4 lines
Pavel
--
Thanks for all the (sleeping) penguins.
Hi!
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standby
Quoted 8 lines
Quoted 3 lines
What makes you think that mixing operating and sleep states is good
idea?They are all power states managed by the kernel and in the operating
point concept they are all operating points the system supports.
That does not make mixing them right.
Quoted 4 lines
The system can be set to any of the supported states by setting their name in the
/sys/power/statefile. I find simplicity
is usually a good thing.
I believe the quote is 'make it as simple as possible but not simpler'.
Quoted 8 lines
Quoted 2 lines
And '600MHz' makes lot more sense than 'lowest' on centrino.
Perhaps, but the common name space makes it easy for the power manager
daemon to perform the same functions without having to know that the lowest
speed on my laptop is 600Mhz.
And enumerate english strings in power daemon? Limiting the numver of states?
Quoted 7 lines
Quoted 6 lines
Quoted 4 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latencyWhat is voltage for 'mem'?
Quoted 7 lines
I don't know what the voltage or latency is for mem. Perhaps Intel could better
say what the voltage is in the suspend state and what the latency was
for transistion to that state. I didn't have the data available when
I wrote the code.
And you will not have data available even if intel helps you. What is _frequency_ for mem? These fields are meaningless for sleep states; that should tell you that mixing sleep and operating states is bad idea.
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 25 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Pavel Machek
Sent: Tuesday, August 29, 2006 11:35 AM
To: David Singleton
Cc: [email protected]
Subject: Re: [linux-pm] So, what's the status on the recent patches here?Hi!
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyQuoted 1 line
Quoted 1 line
What makes you think that mixing operating and sleep
Quoted 8 lines
states is good
Quoted 3 lines
Quoted 1 line
idea?
They are all power states managed by the kernel and in the
operating
Quoted 1 line
point concept they are all operating points the system supports.
That does not make mixing them right.
---
Could you say why you think they shouldn't be mixed? Absent argument to the contrary,
making it a single continuum seems appealing. Why have separate policies?
---
Quoted 8 lines
Quoted 2 lines
The system can be set to any of the supported states by
setting their
Quoted 2 lines
name in the
/sys/power/statefile. I find simplicity is usually a good thing.I believe the quote is 'make it as simple as possible but not simpler'.
---
So, why don't you think this simplification is possible?
---
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
And '600MHz' makes lot more sense than 'lowest' on centrino.
Perhaps, but the common name space makes it easy for the
power manager
Quoted 1 line
daemon to perform the same functions without having to know
that the
Quoted 1 line
lowest speed on my laptop is 600Mhz.
And enumerate english strings in power daemon? Limiting the numver of states?
---
Are you saying that on your laptop, all possible CPU and bus frequencies
can be used independently? So, it would be unnecessarily limiting to have
the system designer provide a list of combinations that work? Remember that
the scope of this is a limited set of parameters, not all the devices in the system.
---
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latencyWhat is voltage for 'mem'?
I don't know what the voltage or latency is for mem. Perhaps Intel could better
say what the voltage is in the suspend state and what thelatency was
Quoted 8 lines
Quoted 1 line
for transistion to that state. I didn't have the data
available when
Quoted 1 line
I wrote the code.
And you will not have data available even if intel helps you. What is _frequency_ for mem? These fields are meaningless for sleep states; that should tell you that mixing sleep and operating states is bad idea.
---
Why isn't 0 a meaningful value for frequency? And I can imagine that some hardware might have different voltage options for sleep States. Additionally, these sys entries could represent the frequency, voltage, etc., that the system would go to upon resuming from sleep...
scott
Quoted 32 lines · Preece Scott-PREECE
Quoted 32 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Pavel Machek
Sent: Tuesday, August 29, 2006 11:35 AM
To: David Singleton
Cc: [email protected]
Subject: Re: [linux-pm] So, what's the status on the recent patches here?Hi!
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyQuoted 1 line
Quoted 1 line
What makes you think that mixing operating and sleep
states is good
Quoted 3 lines
Quoted 1 line
idea?
They are all power states managed by the kernel and in the
operating
Quoted 1 line
point concept they are all operating points the system supports.
Quoted 7 lines
Quoted 1 line
That does not make mixing them right.
---
Could you say why you think they shouldn't be mixed? Absent argument to the contrary,
making it a single continuum seems appealing. Why have separate policies?
I know this questions is directed at Pavel but I have similar concerns.
I agree that making sleep states into operating points is appealing.
However, if the implementation is just going to special case the sleep state operating points then they should be handled separately. As Pavel points out, you can see from Dave's implementation that the
operating point definition doesn't quite work for both. Voltage and
frequency don't have meaning for the sleep points. The per point transition callbacks are needed just to handle the sleep points. Latency has a very different meaning between the two types. Also, the type field is required to identify which points are sleep points and which ones are operating points. I think the concept of using operating points to define sleep states could be a valid one but the implementation provided isn't quite right (yet).
However, this should not detract from mainlining PowerOP. Integrating sleep and operating points is not required to use PowerOP.
Quoted 60 lines
---
Quoted 8 lines
Quoted 2 lines
The system can be set to any of the supported states by
setting their
Quoted 2 lines
name in the
/sys/power/statefile. I find simplicity is usually a good thing.I believe the quote is 'make it as simple as possible but not simpler'.
---
So, why don't you think this simplification is possible?
---
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
And '600MHz' makes lot more sense than 'lowest' on centrino.
Perhaps, but the common name space makes it easy for the
power manager
Quoted 1 line
daemon to perform the same functions without having to know
that the
Quoted 1 line
lowest speed on my laptop is 600Mhz.
And enumerate english strings in power daemon? Limiting the numver of states?
---
Are you saying that on your laptop, all possible CPU and bus frequencies
can be used independently? So, it would be unnecessarily limiting to have
the system designer provide a list of combinations that work? Remember that
the scope of this is a limited set of parameters, not all the devices in
the system.---
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latencyWhat is voltage for 'mem'?
I don't know what the voltage or latency is for mem. Perhaps Intel could better
say what the voltage is in the suspend state and what thelatency was
Quoted 8 lines
Quoted 1 line
for transistion to that state. I didn't have the data
available when
Quoted 1 line
I wrote the code.
And you will not have data available even if intel helps you. What is _frequency_ for mem? These fields are meaningless for sleep states; that should tell you that mixing sleep and operating states is bad idea.
Quoted 6 lines
---
Why isn't 0 a meaningful value for frequency? And I can imagine that some hardware might have different voltage options for sleep States. Additionally, these sys entries could represent the frequency, voltage, etc., that the system would go to upon resuming from sleep...
I think its more an issue with the implementation rather than the concept. We can't just have frequency and voltage as shown in oppoint patches because we don't know which frequency and voltage they refer to. The number of frequency and voltage parameters are completely dependent on the hardware platform.
You bring up a more interesting area to look at integrating sleep states and operating points. Can we add some hooks that allow us to define which operating point is selected at resume? Need to think about that a bit:)
Quoted 8 lines
scott
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 18 lines
From: Matthew Locke [mailto:[email protected]]
...Quoted 4 lines
Could you say why you think [frequencies and sleep states] shouldn't be mixed? Absent argument
to the contrary, making it a single continuum seems appealing. Why have separate policies?I know this questions is directed at Pavel but I have similar concerns.
I agree that making sleep states into operating points is
appealing.
However, if the implementation is just going to special case the sleep state operating points then they should be handled separately. As Pavel points out, you can see from Dave's implementation that the
operating point definition doesn't quite work for both. Voltage and
frequency don't have meaning for the sleep points. The per
Quoted 8 lines
point transition callbacks are needed just to handle the sleep points.
Latency has a very different meaning between the two types. Also, the type field is required to identify which points are sleep points and which ones are operating points. I think the concept of using operating points to define sleep states could be a valid one but the implementation provided isn't quite right (yet).
---
Well, if the object is to present "the right interface" to a user-space policy manager, then I think the argument about whether the implementations
are shared is irrelevant - the whole point would be to abstract away the implementation, which could conceivably be separate hard-coded routines for each operating point. HOWEVER, the second part of your comment, that the interface actually isn't right for describing sleep states, is more compelling and might point a direction for future realignment (or might just be grist for discussion now about the right attributes for operating points.
Quoted 8 lines
...
I think its more an issue with the implementation rather than the concept. We can't just have frequency and voltage as shown in oppoint patches because we don't know which frequency and voltage they refer to. The number of frequency and voltage parameters are completely dependent on the hardware platform.
---
I agree that the set of parameters
describing an OP should be flexible.
---
Quoted 5 lines
You bring up a more interesting area to look at integrating sleep states and operating points. Can we add some hooks that allow us to define which operating point is selected at resume? Need to think about that a bit:)
---
It's an interesting question, and one we (Motorola) don't have hard data to support, yet. Our current implementation remembers the OP in use before sleeping and resumes at the same OP. The argument is that this corresponds to an application that is doing work at a steady-state level (say decoding video), but that has a brief pause to wait for I/O or a timer (say, pausing until the next frame time); then it makes sense that the level of effort required on resume will be the same as before sleeping.
Another possible approach would be to automatically resume at the highest OP, on the assumption that whatever wakes you up will be work to do, so you should be prepared to do it and then sink back to a lower OP as the workload diminishes. That argument is especially appropriate if you have a mechanism that aggregates timers or does periodic scheduling, so that you wake up less often, but do more work at each wakeup.
We're planning to do some research on this, but it's waiting for the infrequent time when there's a lull in product development work...
Scott
Hi!
Quoted 6 lines
Quoted 4 lines
You bring up a more interesting area to look at integrating sleep states and operating points. Can we add some hooks that allow us to define which operating point is selected at resume? Need to think about that a bit:)
---
Quoted 8 lines
It's an interesting question, and one we (Motorola) don't have hard data to support, yet. Our current implementation remembers the OP in use before sleeping and resumes at the same OP. The argument is that this corresponds to an application that is doing work at a steady-state level (say decoding video), but that has a brief pause to wait for I/O or a timer (say, pausing until the next frame time); then it makes sense that the level of effort required on resume will be the same as before sleeping.
We may have confusion here.
On PC, it is definitely not possible to enter sleep state between frames of video... because video is powered off.
On PC, sleep states are *system* sleep states. CPU sleep states exist, too, but that's in-kernel implementation detail. They are called C1..C4.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 16 lines
From: Pavel Machek [mailto:[email protected]]
Quoted 2 lines
It's an interesting question, and one we (Motorola) don't have hard data to support, yet. Our current implementation remembers
the OP in
Quoted 1 line
use before sleeping and resumes at the same OP. The
argument is that
Quoted 2 lines
this corresponds to an application that is doing work at a steady-state level (say decoding video), but that has a
brief pause to
Quoted 1 line
wait for I/O or a timer (say, pausing until the next frame
time); then
Quoted 1 line
it makes sense that the level of effort required on resume
will be the
Quoted 1 line
same as before sleeping.
Quoted 8 lines
We may have confusion here.
On PC, it is definitely not possible to enter sleep state between frames of video... because video is powered off.
On PC, sleep states are *system* sleep states. CPU sleep states exist, too, but that's in-kernel implementation detail. They are called C1..C4.
---
Well, we have some hardware where we can sleep everything but memory and some where we can also leave the display active (and backlit). In fact, however, today the latency for going to sleep is too great to do so between frames, so we just do a wait there. We would LIKE to be able to sleep there at some point in the future and would prefer a power model that made that cleanly part of a continuum of operating points.
However, we definitely DO sleep (with self-refreshing RAM) during relatively short periods, with the wakeup resulting from an interrupt from the RTC (which is self-powered and is set to timeout at the next scheduled timer when we go to sleep) or another hardware interrupt. We think of this as a system-level sleep state.
I'm not sure how you distinguish between a "system" sleep state and a "CPU" sleep state - seems like there's a collection of things that can be shut down or not; except for true OFF, there's always something on.
Scott
Hi!
Quoted 25 lines
Quoted 8 lines
We may have confusion here.
On PC, it is definitely not possible to enter sleep state between frames of video... because video is powered off.
On PC, sleep states are *system* sleep states. CPU sleep states exist, too, but that's in-kernel implementation detail. They are called C1..C4.
---
Well, we have some hardware where we can sleep everything but memory and some where we can also leave the display active (and backlit). In fact, however, today the latency for going to sleep is too great to do so between frames, so we just do a wait there. We would LIKE to be able to sleep there at some point in the future and would prefer a power model that made that cleanly part of a continuum of operating points.
However, we definitely DO sleep (with self-refreshing RAM) during relatively short periods, with the wakeup resulting from an interrupt from the RTC (which is self-powered and is set to timeout at the next scheduled timer when we go to sleep) or another hardware interrupt. We think of this as a system-level sleep state.
Quoted 4 lines
I'm not sure how you distinguish between a "system" sleep state and a "CPU" sleep state - seems like there's a collection of things that can be shut down or not; except for true OFF, there's always something on.
Well, even in "true OFF", RTC keeps ticking. And in "disk" state (swsusp), machine is basically "true OFF" but it still retains state.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 43 lines · Matthew Locke
Quoted 32 lines · Preece Scott-PREECE
Quoted 32 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Pavel Machek
Sent: Tuesday, August 29, 2006 11:35 AM
To: David Singleton
Cc: [email protected]
Subject: Re: [linux-pm] So, what's the status on the recent patches here?Hi!
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyQuoted 1 line
Quoted 1 line
What makes you think that mixing operating and sleep
states is good
Quoted 3 lines
Quoted 1 line
idea?
They are all power states managed by the kernel and in the
operating
Quoted 1 line
point concept they are all operating points the system supports.
Quoted 7 lines
Quoted 1 line
That does not make mixing them right.
---
Could you say why you think they shouldn't be mixed? Absent argument to the contrary,
making it a single continuum seems appealing. Why have separate policies?
Quoted 7 lines
I know this questions is directed at Pavel but I have similar concerns.
I agree that making sleep states into operating points is appealing.
However, if the implementation is just going to special case the sleep state operating points then they should be handled separately. As Pavel points out, you can see from Dave's implementation that the
operating point definition doesn't quite work for both. Voltage and
frequency don't have meaning for the sleep points.
Actually what I was trying, unsuccessfully, to explain was that suspend states are valid, supported operating states the
system can be in for power management. And that they are the
same as an operating point for a processor frequency.
Nothing is being 'mixed' because they are all the same thing; an operating point the system can be in from a power management perspective.
And since they are are valid operating points they should be in the same power management framework and operate through the same interfaces.
And voltage and frequency (and latency) do matter to suspend states. Systems that support multiple suspend states have different power consumption levels (hence the voltage requirement) associated with the different suspend states.
And different suspend states have latencies to get into and the power manager needs to know all of this information.
The power manager must know about the voltage values to determine which state consumes the most or least power.
And the power manager must know about the latencies for different states so it can decide when best to use them. If a suspend state takes too long to enter for the current operation of they system then the power manager may choose to just move to a lower power consumption operating point.
Quoted 2 lines
The per point
transition callbacks are needed just to handle the sleep points.
Not true. The call backs are also needed when transitioning
to a new processor frequency operating point that will affect device state.
The prepare to transition and finish transition callbacks
are needed for transitions between all operating points, whether a suspend or processor frequency point. Which is why I'm using the existing cpufreq scaling callbacks and transitioning between both supported processor frequencies and suspend states is working on different architectures for OpPoint now.
Quoted 1 line
Latency has a very different meaning between the two types.
No, latency means the same thing for all operating points. It's the time it takes to transition into the state (and out of as well).
The power manager needs to know that time it takes to transition into both a new cpu frequency and a suspend state. If the suspend state latency is too long the power manager may choose to just go to a lower frequency operating point.
And when devices can export their latencies to transition into an idle or suspended state the design and model still works.
And in fact the power manager can then better create policies which contain an operating point for the entire system and a set of device states, which is the definition of a policy. And where the huge combination of possible policies comes from.
When the power manager understands the frequency, voltage and latency for each supported operating point and the latencies for idling devices it can then operate in the most efficient manner and create the best power management polices and classes of policies for the system.
Quoted 3 lines
Also, the
type field is required to identify which points are sleep points and which ones are operating points.
They are all operating points. They are all valid, supported states the system can be in. And of course they should be in the same power management framework and work through the same interfaces.
Quoted 97 lines
I think the concept of using
operating points to define sleep states could be a valid one but the implementation provided isn't quite right (yet).However, this should not detract from mainlining PowerOP. Integrating sleep and operating points is not required to use PowerOP.
Quoted 60 lines
---
Quoted 8 lines
Quoted 2 lines
The system can be set to any of the supported states by
setting their
Quoted 2 lines
name in the
/sys/power/statefile. I find simplicity is usually a good thing.I believe the quote is 'make it as simple as possible but not simpler'.
---
So, why don't you think this simplification is possible?
---
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
And '600MHz' makes lot more sense than 'lowest' on centrino.
Perhaps, but the common name space makes it easy for the
power manager
Quoted 1 line
daemon to perform the same functions without having to know
that the
Quoted 1 line
lowest speed on my laptop is 600Mhz.
And enumerate english strings in power daemon? Limiting the numver of states?
---
Are you saying that on your laptop, all possible CPU and bus frequencies
can be used independently? So, it would be unnecessarily limiting to have
the system designer provide a list of combinations that work? Remember that
the scope of this is a limited set of parameters, not all the devices in
the system.---
Quoted 12 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latencyWhat is voltage for 'mem'?
I don't know what the voltage or latency is for mem. Perhaps Intel could better
say what the voltage is in the suspend state and what thelatency was
Quoted 8 lines
Quoted 1 line
for transistion to that state. I didn't have the data
available when
Quoted 1 line
I wrote the code.
And you will not have data available even if intel helps you. What is _frequency_ for mem? These fields are meaningless for sleep states; that should tell you that mixing sleep and operating states is bad idea.
Quoted 6 lines
---
Why isn't 0 a meaningful value for frequency? And I can imagine that some hardware might have different voltage options for sleep States. Additionally, these sys entries could represent the frequency, voltage, etc., that the system would go to upon resuming from sleep...
I think its more an issue with the implementation rather than the concept. We can't just have frequency and voltage as shown in oppoint patches because we don't know which frequency and voltage they refer to. The number of frequency and voltage parameters are completely dependent on the hardware platform.
You bring up a more interesting area to look at integrating sleep states and operating points. Can we add some hooks that allow us to define which operating point is selected at resume? Need to think about that a bit:)
Quoted 8 lines
scott
_______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 52 lines · David Singleton
Quoted 43 lines · Matthew Locke
Quoted 32 lines · Preece Scott-PREECE
Quoted 32 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Pavel Machek
Sent: Tuesday, August 29, 2006 11:35 AM
To: David Singleton
Cc: [email protected]
Subject: Re: [linux-pm] So, what's the status on the recent patches here?Hi!
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyQuoted 1 line
Quoted 1 line
What makes you think that mixing operating and sleep
states is good
Quoted 3 lines
Quoted 1 line
idea?
They are all power states managed by the kernel and in the
operating
Quoted 1 line
point concept they are all operating points the system supports.
Quoted 7 lines
Quoted 1 line
That does not make mixing them right.
---
Could you say why you think they shouldn't be mixed? Absent argument to the contrary,
making it a single continuum seems appealing. Why have separate policies?Quoted 7 lines
I know this questions is directed at Pavel but I have similar concerns.
I agree that making sleep states into operating points is appealing.
However, if the implementation is just going to special case the sleep state operating points then they should be handled separately. As Pavel points out, you can see from Dave's implementation that the
operating point definition doesn't quite work for both. Voltage and
frequency don't have meaning for the sleep points.
Quoted 4 lines
Actually what I was trying, unsuccessfully, to explain was that suspend states are valid, supported operating states the
system can be in for power management. And that they are the
same as an operating point for a processor frequency.
That depends on the definition, but I think of suspend states as the ones that require processes to be frozen before they can be entered. IMHO it is quite clear that such states cannot be handled in the same way as those that do not require the freezing of processes, so they are not the same.
Greetings,
Rafael
Signature · 2 lines
You never change things by fighting the existing reality. R. Buckminster Fuller
Quoted 58 lines · Rafael J. Wysocki
Quoted 52 lines · David Singleton
Quoted 43 lines · Matthew Locke
Quoted 32 lines · Preece Scott-PREECE
Quoted 32 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Pavel Machek
Sent: Tuesday, August 29, 2006 11:35 AM
To: David Singleton
Cc: [email protected]
Subject: Re: [linux-pm] So, what's the status on the recent patches here?Hi!
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyQuoted 1 line
Quoted 1 line
What makes you think that mixing operating and sleep
states is good
Quoted 3 lines
Quoted 1 line
idea?
They are all power states managed by the kernel and in the
operating
Quoted 1 line
point concept they are all operating points the system supports.
Quoted 7 lines
Quoted 1 line
That does not make mixing them right.
---
Could you say why you think they shouldn't be mixed? Absent argument to the contrary,
making it a single continuum seems appealing. Why have separate policies?Quoted 7 lines
I know this questions is directed at Pavel but I have similar concerns.
I agree that making sleep states into operating points is appealing.
However, if the implementation is just going to special case the sleep state operating points then they should be handled separately. As Pavel points out, you can see from Dave's implementation that the
operating point definition doesn't quite work for both. Voltage and
frequency don't have meaning for the sleep points.Quoted 4 lines
Actually what I was trying, unsuccessfully, to explain was that suspend states are valid, supported operating states the
system can be in for power management. And that they are the
same as an operating point for a processor frequency.
Quoted 4 lines
That depends on the definition, but I think of suspend states as the ones that require processes to be frozen before they can be entered. IMHO it is quite clear that such states cannot be handled in the same way as those that do not require the freezing of processes, so they are not the same.
You are correct, processes do need to be frozen before a suspend. That's the prepare to suspend part of the suspend process, and the transtition is the suspending and finish is the un-freezing of the processes to resume execution.
And those same steps are the same steps required to transition the system to a new operating point, whether it's suspend or change from 1.4GHz to 600MHz.
Quoted 9 lines
Greetings,
Rafael--
You never change things by fighting the existing reality.
R. Buckminster Fuller
Quoted 64 lines · David Singleton
Quoted 58 lines · Rafael J. Wysocki
Quoted 52 lines · David Singleton
Quoted 43 lines · Matthew Locke
Quoted 32 lines · Preece Scott-PREECE
Quoted 32 lines
From: [email protected] [mailto:[email protected]] On Behalf Of Pavel Machek
Sent: Tuesday, August 29, 2006 11:35 AM
To: David Singleton
Cc: [email protected]
Subject: Re: [linux-pm] So, what's the status on the recent patches here?Hi!
Quoted 14 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyQuoted 1 line
Quoted 1 line
What makes you think that mixing operating and sleep
states is good
Quoted 3 lines
Quoted 1 line
idea?
They are all power states managed by the kernel and in the
operating
Quoted 1 line
point concept they are all operating points the system supports.
Quoted 7 lines
Quoted 1 line
That does not make mixing them right.
---
Could you say why you think they shouldn't be mixed? Absent argument to the contrary,
making it a single continuum seems appealing. Why have separate policies?Quoted 7 lines
I know this questions is directed at Pavel but I have similar concerns.
I agree that making sleep states into operating points is appealing.
However, if the implementation is just going to special case the sleep state operating points then they should be handled separately. As Pavel points out, you can see from Dave's implementation that the
operating point definition doesn't quite work for both. Voltage and
frequency don't have meaning for the sleep points.Quoted 4 lines
Actually what I was trying, unsuccessfully, to explain was that suspend states are valid, supported operating states the
system can be in for power management. And that they are the
same as an operating point for a processor frequency.Quoted 4 lines
That depends on the definition, but I think of suspend states as the ones that require processes to be frozen before they can be entered. IMHO it is quite clear that such states cannot be handled in the same way as those that do not require the freezing of processes, so they are not the same.
Quoted 8 lines
You are correct, processes do need to be frozen before a suspend. That's the prepare to suspend part of the suspend process, and the transtition is the suspending and finish is the un-freezing of the processes to resume execution.
And those same steps are the same steps required to transition the system to a new operating point, whether it's suspend or change from 1.4GHz to 600MHz.
There are only a few states that require the processes to be frozen and I think that's a good enough reason to handle them separately.
Greetings,
Rafael
Signature · 2 lines
You never change things by fighting the existing reality. R. Buckminster Fuller
Quoted 5 lines
Quoted 4 lines
That depends on the definition, but I think of suspend states as the ones that require processes to be frozen before they can be entered. IMHO it is quite clear that such states cannot be handled in the same way as those that do not require the freezing of processes, so they are not the same.
Quoted 8 lines
You are correct, processes do need to be frozen before a suspend. That's the prepare to suspend part of the suspend process, and the transtition is the suspending and finish is the un-freezing of the processes to resume execution.
And those same steps are the same steps required to transition the system to a new operating point, whether it's suspend or change from 1.4GHz to 600MHz.
No, processes are not frozen for simple cpu frequency change -- on non-broken cpus.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 10 lines · Pavel Machek
Quoted 10 lines
Quoted 4 lines
That depends on the definition, but I think of suspend states as the ones that require processes to be frozen before they can be entered. IMHO it is quite clear that such states cannot be handled in the same way as those that do not require the freezing of processes, so they are not the same.
You are correct, processes do need to be frozen before a suspend. That's the prepare to suspend part of the suspend process, and the transtition is the suspending and finish is the un-freezing of the processes to resume execution.
Quoted 6 lines
Quoted 3 lines
And those same steps are the same steps required to transition the system to a new operating point, whether it's suspend or change from 1.4GHz to 600MHz.
No, processes are not frozen for simple cpu frequency change -- on non-broken cpus.
I didn't say cpu frequency changes freeze processes. I said a suspend does a prepare to suspend step (which freezes processes) and a cpu frequency change does a prepare to change frequency step (where it will run the driver notifier list to get drivers set to scale).
They both do the same three steps:
1) prepare to transition
2) transition
3) finish transition
That's one of my arguements as to why suspend states should be treated just like frequency states.
David
Quoted 5 lines
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
I've been off doing real work for a while but I've finally got some time to work on SMP and device constraints for the oppoint patch set.
I hope to have SMP tested in the next few days and I have device constraints working on the arm-pxa27x platform.
The latest patch set is running meg movies while scaling
frequencies, either
manuall or with the oppointd power manager daemon, and the
video runs correctly
during frequency scaling operations.
The device constraints design has also simplified the core patch. I no longer have to touch device.h, driver.c, resume.c, or suspend.c.
The only files in the core framework patch now are:
kernel/power/main.c
include/linux/pm.h
kernel/power/power.h
drivers/base/power/Makefile
drivers/base/power/oppoint.c
Constraints Design:
Constraints are a device attribute. A device must deteremine if the new target operating point will cause the device to fail to operate correctly. An example is an LCD device whose driving clock will be set too low to operate correctly.
In the OpPoint design device constraints are checked in the prepare_transition routines of each device. When the transition notifier list is run for driver scaling functions the PRECHANGE operation will check for constraints conditions and return -EINVAL to signify the operating point would put the device into and illegal or non functional state.
The PRECHANGE function will also check to see if the device has been suspended and constraints checks are not needed.
If the prepare_transition routine returns -EINVAL the new target operating point will not be set.
Once I get SMP working well I'm going to spend some time thinking about suspend operating states. The pm_ops structure looks suspicioulsy like a subset of the oppoint structure. If I can figure out a way to truely make all suspend states normal operating points I believe the enter_state and pm_change_state functions can be merged into a single function that handles both changes to suspend states and changes to new frequency or new voltage states.
I also want to order the suspend states according to their power consumption levels to give the power manager better control over which suspend states will save the most power. I think it will be something along the lines of the suspend states names signifying and ordering, the same way I do for frequency and voltage operating points.
Again the full patch set is at:
http://source.mvista.com/~dsingleton/2.6.18-rc6
The power manager is at:
http://source.mvista.com/~dsingleton/oppointd
Comments and flamages that improve the design and code are always welcome.
Attached is the core patch.
David
drivers/base/power/Makefile | 2 drivers/base/power/oppoint.c | 74 +++++++++ include/linux/pm.h | 34 ++++ kernel/power/main.c | 328 +++++++++++++++++++++++++++++++++++++------ kernel/power/power.h | 2 5 files changed, 396 insertions(+), 44 deletions(-)
kernel/power/main.c +288 -40
@@ -16,6 +16,7 @@#include <linux/init.h> #include <linux/pm.h> #include <linux/console.h> +#include <linux/module.h> #include "power.h"
@@ -49,7 +50,7 @@ void pm_set_ops(struct pm_ops * ops)* the platform can enter the requested state. */ -static int suspend_prepare (suspend_state_t state) +static int suspend_prepare (struct oppoint * state) {int error =0 ;unsigned int free_pages;
@@ -82,7 +83,7 @@ static int suspend_prepare(suspend_state }if (pm_ops->prepare) { -if ((error = pm_ops->prepare (state))) +if ((error = pm_ops->prepare (state->type))) goto Thaw; }
@@ -94,7 +95,7 @@ static int suspend_prepare(suspend_statereturn 0 ; Finish:if (pm_ops->finish) - pm_ops->finish (state); + pm_ops->finish (state->type); Thaw:thaw_processes (); Enable_cpu:
@@ -104,7 +105,7 @@ static int suspend_prepare(suspend_state } -int suspend_enter (suspend_state_t state) +int suspend_enter (struct oppoint * state) {int error =0 ;unsigned long flags;
@@ -115,7 +116,7 @@ int suspend_enter(suspend_state_t state)printk (KERN_ERR "Some devices failed to power down\n" ); goto Done; } - error = pm_ops->enter (state); + error = pm_ops->enter (state->type);device_power_up (); Done:local_irq_restore (flags);
@@ -131,36 +132,98 @@ int suspend_enter(suspend_state_t state)* console that we've allocated. This is not called for suspend-to-disk. */ -static void suspend_finish (suspend_state_t state) +static void suspend_finish (struct oppoint * state) {device_resume ();resume_console ();thaw_processes ();enable_nonboot_cpus ();if (pm_ops && pm_ops->finish) - pm_ops->finish (state); + pm_ops->finish (state->type);pm_restore_console (); } +struct oppoint *current_state; +struct oppoint pm_states = { + .name ="default" , + .type =PM_SUSPEND_ON , +}; + +static struct oppoint standby = { + .name ="standby" , + .type =PM_SUSPEND_STANDBY , +}; +struct oppoint *oppoint_standby; +static struct oppoint mem = { + .name ="mem" , + .type =PM_SUSPEND_MEM , + .frequency =0 , + .voltage =0 , + .latency =150 , +}; +struct oppoint *oppoint_mem; -static const char *const pm_states[PM_SUSPEND_MAX ] = { - [PM_SUSPEND_STANDBY ] ="standby" , - [PM_SUSPEND_MEM ] ="mem" ,#ifdef CONFIG_SOFTWARE_SUSPEND - [PM_SUSPEND_DISK ] ="disk" , -#endif +struct oppoint disk = { + .name ="disk" , + .type =PM_SUSPEND_DISK , }; +#endif -static inline int valid_state (suspend_state_t state) +/* +* +*/ +static int pm_change_state (struct oppoint *state) +{ +int error =0 ; + +printk ("OpPoint: changing from %s to %s\n" , current_state->name, + state->name); +/* +* compare to current operating point. +* if different change to new operating point. +*/ +if (current_state == state) + goto out; + +/* +* prepare_transition does device constraint checking. If +* a new operating point will put a device in an unsupported +* state, lcd clock too low, NIC bus too low, etc. the new state +* cannot be entered (until the constrainded device is suspended). +* If prepare_transition fails we don't go to the new operating +* point. +*/ +if ((error = state->prepare_transition (current_state, state))) + goto out; + +/* +* if the transition fails we call the finish transistion +* with the current state as the new state, causing +* the finish to return to the current_state. +*/ + +if ((error = state->transition (current_state, state))) + state = current_state; + +if ((state->finish_transition (current_state, state)) ==0 ) + current_state = state; + +out: +printk ("OpPoint: State change returned %d\n" , error); +return error; +} + +static inline int valid_state (struct oppoint * state) {/* Suspend-to-disk does not really need low-level support. * It can work with reboot if needed. */ -if (state ==PM_SUSPEND_DISK ) +if (state->type ==PM_SUSPEND_DISK )return 1 ; -if (pm_ops && pm_ops->valid && !pm_ops->valid (state)) +if (pm_ops && pm_ops->valid && !pm_ops->valid (state->type))return 0 ;return 1 ; }
@@ -168,7 +231,7 @@ static inline int valid_state(suspend_st/** * enter_state - Do common work of entering low-power state. -* @state: pm_state structure for state we're entering. +* @state: oppoint structure for state we're entering. * * Make sure we're the only ones trying to enter a sleep state. Fail * if someone has beat us to it, since we don't want anything weird to
@@ -177,7 +240,7 @@ static inline int valid_state(suspend_st* we've woken up). */ -static int enter_state (suspend_state_t state) +static int enter_state (struct oppoint *state) {int error;
@@ -186,16 +249,21 @@ static int enter_state(suspend_state_t sif (down_trylock (&pm_sem))return -EBUSY ; -if (state ==PM_SUSPEND_DISK ) { +if (state->type ==PM_SUSPEND_DISK ) { error =pm_suspend_disk (); goto Unlock; } -pr_debug ("PM: Preparing system for %s sleep\n" , pm_states[state]); +if (state->type ==PM_FREQ_CHANGE || state->type ==PM_VOLT_CHANGE ) { + error =pm_change_state (state); + goto Unlock; + } + +pr_debug ("PM: Preparing system for %s sleep\n" , state->name);if ((error =suspend_prepare (state))) goto Unlock; -pr_debug ("PM: Entering %s sleep\n" , pm_states[state]); +pr_debug ("PM: Entering %s sleep\n" , state->name); error =suspend_enter (state);pr_debug ("PM: Finishing wakeup.\n" );
@@ -211,7 +279,15 @@ static int enter_state(suspend_state_t s*/ int software_suspend (void ) { -return enter_state (PM_SUSPEND_DISK ); +struct oppoint *this, *next; +struct list_head *head = &pm_states.list; +int error =0 ; + +list_for_each_entry_safe (this, next, head, list) { +if (this->type ==PM_SUSPEND_DISK ) + error=enter_state (this); + } +return error; }
@@ -223,9 +299,9 @@ int software_suspend(void)* structure, and enter (above). */ -int pm_suspend (suspend_state_t state) +int pm_suspend (struct oppoint * state) { -if (state >PM_SUSPEND_ON && state <=PM_SUSPEND_MAX ) +if (state->type >PM_SUSPEND_ON && state->type <=PM_SUSPEND_MAX )return enter_state (state);return -EINVAL ; }
@@ -248,36 +324,29 @@ decl_subsys(power,NULL,NULL);static ssize_t state_show (struct subsystem * subsys,char * buf) { -int i;char * s = buf; -for (i =0 ; i <PM_SUSPEND_MAX ; i++) { -if (pm_states[i] &&valid_state (i)) - s +=sprintf (s,"%s " , pm_states[i]); - } - s +=sprintf (s,"\n" ); + s +=sprintf (s,"%s\n" , current_state->name);return (s - buf); }static ssize_t state_store (struct subsystem * subsys,const char * buf,size_t n) { -suspend_state_t state =PM_SUSPEND_STANDBY ; -const char *const *s; +struct oppoint *this, *next; +struct list_head *head = &pm_states.list;char *p; -int error; +int error = -EINVAL ;int len; p =memchr (buf,'\n' , n); len = p ? p - buf : n; - -for (s = &pm_states[state]; state <PM_SUSPEND_MAX ; s++, state++) { -if (*s && !strncmp (buf, *s, len)) +list_for_each_entry_safe (this, next, head, list) { +if ((strlen (this->name) == len) && + (!strncmp (this->name, buf, len))) { + error =enter_state (this);break ; + } } -if (state <PM_SUSPEND_MAX && *s) - error =enter_state (state); -else - error = -EINVAL ;return error ? error : n; }
@@ -292,12 +361,191 @@ static struct attribute_group attr_group .attrs = g, }; +static struct kobject oppoint_kobj = { + .kset = &power_subsys.kset, +}; + +struct oppoint_attribute { +struct attribute attr; +ssize_t (*show)(struct kobject * kobj,char * buf); +ssize_t (*store)(struct kobject * kobj,const char * buf,size_t count); +}; + +#define to_oppoint (obj) container_of(obj,struct oppoint,kobj) +#define to_oppoint_attr (_attr) container_of(_attr,struct oppoint_attribute,attr) +/* +* the frequency, voltage and latency files are readonly +*/ + +static ssize_t oppoint_voltage_show (struct kobject * kobj,char * buf) +{ +ssize_t len; +struct oppoint *opt =to_oppoint (kobj); + + len =sprintf (buf,"%8d\n" , opt->voltage); + +return len; +} + +static ssize_t oppoint_voltage_store (struct kobject * kobj,const char * buf, +size_t n) +{ +return -EINVAL ; + +} + +static ssize_t oppoint_frequency_show (struct kobject * kobj,char * buf) +{ +ssize_t len; +struct oppoint *opt =to_oppoint (kobj); + + len =sprintf (buf,"%8d\n" , opt->frequency); + +return len; +} + +static ssize_t oppoint_frequency_store (struct kobject * kobj, +const char * buf,size_t n) +{ +return -EINVAL ; + +} + +static ssize_t oppoint_latency_show (struct kobject * kobj,char * buf) +{ +ssize_t len; +struct oppoint *opt =to_oppoint (kobj); + + len =sprintf (buf,"%8d\n" , opt->latency); + +return len; +} + +static ssize_t oppoint_latency_store (struct kobject * kobj, +const char * buf,size_t n) +{ +return -EINVAL ; + +} + +static struct oppoint_attribute frequency_attr = { + .attr = { + .name ="frequency" , + .mode =0400 , + }, + .show = oppoint_frequency_show, + .store = oppoint_frequency_store, +}; + +static struct oppoint_attribute voltage_attr = { + .attr = { + .name ="voltage" , + .mode =0400 , + }, + .show = oppoint_voltage_show, + .store = oppoint_voltage_store, +}; + +static struct oppoint_attribute latency_attr = { + .attr = { + .name ="latency" , + .mode =0400 , + }, + .show = oppoint_latency_show, + .store = oppoint_latency_store, +}; + +static ssize_t +oppoint_attr_show (struct kobject * kobj,struct attribute * attr,char * buf) +{ +struct oppoint_attribute * opt_attr =to_oppoint_attr (attr); +ssize_t ret =0 ; + +if (opt_attr->show) + ret = opt_attr->show (kobj,buf); +return ret; +} + +static ssize_t +oppoint_attr_store (struct kobject * kobj,struct attribute * attr, +const char * buf,size_t count) +{ +return -EINVAL ; +} + +static void oppoint_kobj_release (struct kobject *kobj) +{ +return ; +} + +static struct sysfs_ops oppoint_sysfs_ops = { + .show = oppoint_attr_show, + .store = oppoint_attr_store, +}; + +static struct attribute * oppoint_default_attrs[] = { + &frequency_attr.attr, + &voltage_attr.attr, + &latency_attr.attr, +NULL , +}; + +static struct kobj_type ktype_operating_point = { + .release = oppoint_kobj_release, + .sysfs_ops = &oppoint_sysfs_ops, + .default_attrs = oppoint_default_attrs, +}; + +int unregister_operating_point (struct oppoint *opt) +{ +down (&pm_sem); +list_del_init (&opt->list); +sysfs_remove_file (&opt->kobj, &frequency_attr.attr); +sysfs_remove_file (&opt->kobj, &voltage_attr.attr); +sysfs_remove_file (&opt->kobj, &latency_attr.attr); +up (&pm_sem); +} +EXPORT_SYMBOL (unregister_operating_point); + +int register_operating_point (struct oppoint *opt) +{ +down (&pm_sem); +kobject_set_name (&opt->kobj, opt->name); + opt->kobj.kset = &power_subsys.kset; + opt->kobj.parent = &oppoint_kobj; + opt->kobj.ktype = &ktype_operating_point; +kobject_register (&opt->kobj); + +sysfs_create_file (&opt->kobj, &frequency_attr.attr); +sysfs_create_file (&opt->kobj, &voltage_attr.attr); +sysfs_create_file (&opt->kobj, &latency_attr.attr); + +list_add_tail (&opt->list, &pm_states.list); +up (&pm_sem); +return 0 ; +} +EXPORT_SYMBOL (register_operating_point);static int __init pm_init (void ) { +int error =subsystem_register (&power_subsys); -if (!error) +if (!error) { error =sysfs_create_group (&power_subsys.kset.kobj,&attr_group); +kobject_set_name (&oppoint_kobj,"operating_points" ); +kobject_register (&oppoint_kobj); + } + + +INIT_LIST_HEAD (&pm_states.list); + +#ifdef CONFIG_SOFTWARE_SUSPEND +register_operating_point (&disk); +#endif +register_operating_point (&mem); +register_operating_point (&standby); + current_state = &pm_states; +return error; }
include/linux/pm.h +32 -2
@@ -24,6 +24,7 @@#ifdef __KERNEL__#include <linux/list.h> +#include <linux/kobject.h> #include <asm/atomic.h> /*
@@ -108,7 +109,36 @@ typedef int __bitwise suspend_state_t;#define PM_SUSPEND_STANDBY ((__force suspend_state_t) 1)#define PM_SUSPEND_MEM ((__force suspend_state_t) 3)#define PM_SUSPEND_DISK ((__force suspend_state_t) 4) -#define PM_SUSPEND_MAX ((__force suspend_state_t) 5) +#define PM_FREQ_CHANGE ((__force suspend_state_t) 5) +#define PM_VOLT_CHANGE ((__force suspend_state_t) 6) +#define PM_SUSPEND_MAX ((__force suspend_state_t) 7) + +struct oppoint { +struct list_head list; +suspend_state_t type; +unsigned int flags; +char *name; +unsigned int frequency;/* in KHz */ +unsigned int voltage;/* mV */ +unsigned int latency;/* transition latency in us */ +int (*prepare_transition)(struct oppoint *cur,struct oppoint *new); +int (*transition)(struct oppoint *cur,struct oppoint *new); +int (*finish_transition)(struct oppoint *cur,struct oppoint *new); + +void *md_data;/* arch dependent data */ +struct kobject kobj; +}; + + +extern struct oppoint pm_states; +extern struct oppoint *current_state; +extern unsigned long oppoint_compute_lpj (unsigned long ref,u_int div,u_int mult); +extern int register_operating_point (struct oppoint *opt); +extern int unregister_operating_point (struct oppoint *opt); +struct notifier_block ; +extern void oppoint_register_scale (struct notifier_block *nb,int level); +extern void oppoint_unregister_scale (struct notifier_block *nb,int level); +extern int oppoint_driver_scale (int level,struct oppoint *new);typedef int __bitwise suspend_disk_method_t ;
@@ -128,7 +158,7 @@ struct pm_ops {extern void pm_set_ops (struct pm_ops *);extern struct pm_ops *pm_ops; -extern int pm_suspend (suspend_state_t state); +extern int pm_suspend (struct oppoint *state);/*
kernel/power/power.h +1 -1
@@ -113,4 +113,4 @@ extern int swsusp_resume(void);extern int swsusp_read (void );extern int swsusp_write (void );extern void swsusp_close (void ); -extern int suspend_enter (suspend_state_t state); +extern int suspend_enter (struct oppoint * state);
drivers/base/power/Makefile +1 -1
@@ -1,4 +1,4 @@ -obj-y := shutdown.o +obj-y := shutdown.o oppoint.o obj-$(CONFIG_PM) += main.o suspend.o resume.o runtime.o sysfs.o obj-$(CONFIG_PM_TRACE) += trace.o
drivers/base/power/oppoint.c new file +74 -0
74 lines not on this page · raw message
Hi!
Quoted 4 lines · David Singleton
I've been off doing real work for a while but I've finally got some time
to work on SMP and device constraints for the oppoint patch set.
Could you teach your mail client not to insert tabs at begining of line, and inline your patches?
Quoted 6 lines
Once I get SMP working well I'm going to spend some time thinking
about suspend operating states. Thepm_opsstructure looks
suspicioulsy like a subset of the oppoint structure. If I can
Just because a is subset of b does not mean that merging a and b is good idea.
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 5 lines · David Singleton
Quoted 4 lines · Pavel Machek
Quoted 3 lines
And those same steps are the same steps required to transition the system to a new operating point, whether it's suspend or change from 1.4GHz to 600MHz.
Quoted 7 lines
Quoted 2 lines
No, processes are not frozen for simple cpu frequency change -- on non-broken cpus.
I didn't say cpu frequency changes freeze processes. I said a suspend does a prepare to suspend step (which freezes processes) and a cpu frequency change does a prepare to change frequency step (where it will run the driver notifier list to get drivers set to scale).
Yep, and switching consoles is also same. It is prepare to switch, do a switch, notify people you switched. Shall we use same code?
Quoted 10 lines
They both do the same three steps:
1) prepare to transition
2) transition
3) finish transition
That's one of my arguements as to why suspend states should be treated just like frequency states.
Cat and horse is a same animal. They both have 4 legs, one head and a tail.
Anyway, as a software suspend maintainer, I do not want you to add non-sleeping states to /sys/power/state. I will NAK any attempt to do so. Please find more suitable interface.
Pavel
Signature · 1 line
Thanks for all the (sleeping) penguins.
Quoted 9 lines · Pavel Machek
Quoted 8 lines · David Singleton
Quoted 6 lines · Pavel Machek
Quoted 3 lines
And those same steps are the same steps required to transition the system to a new operating point, whether it's suspend or change from 1.4GHz to 600MHz.
No, processes are not frozen for simple cpu frequency change -- on non-broken cpus.
Quoted 7 lines
Quoted 4 lines
I didn't say cpu frequency changes freeze processes. I said a suspend does a prepare to suspend step (which freezes processes) and a cpu frequency change does a prepare to change frequency step (where it will run the driver notifier list to get drivers set to scale).
Yep, and switching consoles is also same. It is prepare to switch, do a switch, notify people you switched. Shall we use same code?
No. Since switching console is not dealing with changing the operating state of the system. It's just switching which device is the console.
Quoted 12 lines
Quoted 11 lines
They both do the same three steps:
1) prepare to transition
2) transition
3) finish transition
That's one of my arguements as to why suspend states should be treated just like frequency states.
Quoted 6 lines
Cat and horse is a same animal. They both have 4 legs, one head and a tail.
Anyway, as a software suspend maintainer, I do not want you to add non-sleeping states to
/sys/power/state. I will NAK any attempt to do so. Please find more suitable interface.
You are right. The power/state files for devices are for suspend states as well. I'll find a different interface for operating states and leave suspend states in /sys/power/state.
David
Quoted 5 lines
Pavel
--
Thanks for all the (sleeping) penguins.
Hi!
Quoted 10 lines
Quoted 6 lines
Cat and horse is a same animal. They both have 4 legs, one head and a tail.
Anyway, as a software suspend maintainer, I do not want you to add non-sleeping states to
/sys/power/state. I will NAK any attempt to do so. Please find more suitable interface.You are right. The power/state files for devices are for suspend states as well. I'll find a different interface for operating states and leave suspend states in
/sys/power/state.
Thanks!
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 40 lines · David Singleton
Quoted 17 lines · Pavel Machek
Quoted 8 lines · David Singleton
Quoted 6 lines · Pavel Machek
Quoted 3 lines
And those same steps are the same steps required to transition the system to a new operating point, whether it's suspend or change from 1.4GHz to 600MHz.
No, processes are not frozen for simple cpu frequency change -- on non-broken cpus.
Quoted 7 lines
I didn't say cpu frequency changes freeze processes. I said a suspend
does a prepare to suspend step (which freezes processes) and a cpu frequency
change does a prepare to change frequency step (where it will run the driver
notifier list to get drivers set to scale).Quoted 2 lines
Yep, and switching consoles is also same. It is prepare to switch, do a switch, notify people you switched. Shall we use same code?
No. Since switching console is not dealing with changing the operating state of the system. It's just switching which device is the console.
Quoted 16 lines
Quoted 5 lines
They both do the same three steps:
1) prepare to transition
Quoted 7 lines
2) transition
3) finish transition
That's one of my arguements as to why suspend states should be treated
just like frequency states.Cat and horse is a same animal. They both have 4 legs, one head and a tail.
Quoted 8 lines
Quoted 3 lines
Anyway, as a software suspend maintainer, I do not want you to add non-sleeping states to
/sys/power/state. I will NAK any attempt to do so. Please find more suitable interface.You are right. The power/state files for devices are for suspend states as well. I'll find a different interface for operating states and
leave suspend states in/sys/power/state.
You are just duplicating work that is already done in powerOP. I still don't understand why you are redoing all the work Eugeny and I have done. Nothing in our PowerOP interface prevents you from building on top achieve your goals.
Quoted 12 lines
David
Quoted 5 lines
Pavel
--
Thanks for all the (sleeping) penguins._______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 19 lines · Pavel Machek
Hi!
Quoted 18 lines
Quoted 17 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyWhat makes you think that mixing operating and sleep states is good
idea?
Quoted 6 lines
Quoted 4 lines
They are all power states managed by the kernel and in the operating
point concept they are all operating points the system supports.That does not make mixing them right.
Both OpPoint and PowerOp are going to 'mix' frequency, voltage and sleep states into their operating point concepts.
The point was not to make it look like I was mixing sleep states and CPU frequency states, but to present all the power states supported by the system in one place and with one interface. It simplifies not only kernel code, but power manager code as well.
Quoted 12 lines
Quoted 5 lines
The system can be set to any of the supported states by setting their name in the
/sys/power/statefile. I find simplicity
is usually a good thing.I believe the quote is 'make it as simple as possible but not simpler'.
Quoted 3 lines
Quoted 2 lines
And '600MHz' makes lot more sense than 'lowest' on centrino.
Quoted 8 lines
Quoted 5 lines
Perhaps, but the common name space makes it easy for the power manager
daemon to perform the same functions without having to know that the lowest
speed on my laptop is 600Mhz.And enumerate english strings in power daemon? Limiting the numver of states?
Hah, I didn't think of it that way. I was thinking in the same way
"mem" and "disk" and "standy" are strings in the kernel.
The names themselves don't mean anything other than to imply an order so the
kernel and power manager can understand the same order.
I have the oppointd daemon running on systems of different architectures and different numbers of operating points. Some have only two operating points defined, some have three, some have five and one has six.
The power manager functions the same on all of them because of the ordering presented by the names.
The oppointd daemon also understands that the operating points associated with the names may be sparsely populated. The daemon can still work correctly on a sparsely populated name space because of the ordering implied. It works unchanged
on systems with only two states and on systems with six states.
Quoted 16 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latencyWhat is voltage for 'mem'?
Quoted 7 lines
I don't know what the voltage or latency is for mem. Perhaps Intel could better
say what the voltage is in the suspend state and what the latency was
for transistion to that state. I didn't have the data available when
I wrote the code.
Quoted 4 lines
And you will not have data available even if intel helps you. What is _frequency_ for mem? These fields are meaningless for sleep states; that should tell you that mixing sleep and operating states is bad idea.
Actually the SoC concerns that both OpPoint and PowerOp are trying to deal with have different power consumption levels associated with different sleep states.
Different sleep states have different power consumption levels and different transition latencies. The power manager needs to understand both the power consumption level with each sleep state and the transition latency so it can make decisions about when to transition into different sleep states.
Typically sleep states with the lowest power consumption have the longest transition latencies. The power manager must know the power consumption and transition latencies so it can decide when best to switch to a sleep state that consumes a bit more power but has
a much shorter latency to switch into and out of, and
when it's okay to switch to the lowest sleep state, but longest transition latency.
Quoted 4 lines
--
Thanks for all the (sleeping) penguins.
Quoted 25 lines · David Singleton
Quoted 24 lines · Pavel Machek
Hi!
Quoted 22 lines
Quoted 14 lines
Quoted 1 line
point, by name. There is a new
/sys/power/operating_pointsdirectoryQuoted 1 line
that shows all the operating points the
system supports. An
Quoted 9 lines
exampled from my centrino laptop shows:
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standbyQuoted 3 lines
What makes you think that mixing operating and sleep states is good
idea?They are all power states managed by the kernel and in the operating
point concept they are all operating points the system supports.
Quoted 4 lines
Quoted 1 line
That does not make mixing them right.
Both OpPoint and PowerOp are going to 'mix' frequency, voltage and sleep states into their operating point concepts.
PowerOP does not mix sleep states with operating points. We are not pushing for integrating sleep states and operating points. I haven't seen an implementation that makes sense yet. I'm writing another email to address this in more detail.
Quoted 83 lines
The point was not to make it look like I was mixing sleep states and CPU frequency states, but to present all the power states supported by the system in one place and with one interface. It simplifies
not only kernel code, but power manager code as well.Quoted 12 lines
Quoted 5 lines
The system can be set to any of the supported states by setting their name in the
/sys/power/statefile. I find simplicity
is usually a good thing.I believe the quote is 'make it as simple as possible but not simpler'.
Quoted 3 lines
Quoted 2 lines
And '600MHz' makes lot more sense than 'lowest' on centrino.
Quoted 8 lines
Quoted 5 lines
Perhaps, but the common name space makes it easy for the power manager
daemon to perform the same functions without having to know that the lowest
speed on my laptop is 600Mhz.And enumerate english strings in power daemon? Limiting the numver of states?
Hah, I didn't think of it that way. I was thinking in the same way
"mem" and "disk" and "standy" are strings in the kernel.The names themselves don't mean anything other than to imply an order
so the
kernel and power manager can understand the same order.I have the oppointd daemon running on systems of different architectures
and different numbers of operating points. Some have only two operating
points defined, some have three, some have five and one has six.The power manager functions the same on all of them because of the ordering
presented by the names.The oppointd daemon also understands that the operating points associated
with the names may be sparsely populated. The daemon can still work correctly on a sparsely populated name space because of the ordering implied. It works unchanged
on systems with only two states and on systems with six states.Quoted 16 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
/sys/power/operating_points/high/frequency/sys/power/operating_points/high/voltage/sys/power/operating_points/high/latencyWhat is voltage for 'mem'?
Quoted 7 lines
I don't know what the voltage or latency is for mem. Perhaps Intel could better
say what the voltage is in the suspend state and what the latency was
for transistion to that state. I didn't have the data available when
I wrote the code.Quoted 4 lines
And you will not have data available even if intel helps you. What is _frequency_ for mem? These fields are meaningless for sleep states; that should tell you that mixing sleep and operating states is bad idea.
Actually the SoC concerns that both OpPoint and PowerOp are trying to deal with have different power consumption levels associated with different sleep states.
Different sleep states have different power consumption levels and different transition latencies. The power manager needs to understand both the power consumption level with each sleep state and the transition latency so it can make decisions about when to transition into different sleep states.
Quoted 9 lines
Typically sleep states with the lowest power consumption have the longest transition latencies. The power manager must know the power consumption and transition latencies so it can decide when best to
switch to a sleep state that consumes a bit more power but has a much shorter latency to switch into and out of, and when it's okay to switch to the lowest sleep state, but longest transition latency.
Latency is a good example of how mixing sleep states with operating points doesn't quite work. Latency for switching to a new operating
point is very a much a function of the current operating point. I
think latency for sleep states is the same every time. Also which direction are you capturing latency for, suspend or resume? If your power manager is making decisions based on latency, I could imagine that it needs to know the latency for going into and out of that state.
Quoted 9 lines
Quoted 4 lines
--
Thanks for all the (sleeping) penguins._______________________________________________
linux-pm mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/linux-pm
Quoted 12 lines
[mailto:[email protected]] On Behalf Of Matthew Locke
Latency is a good example of how mixing sleep states with operating points doesn't quite work. Latency for switching to a new operating
point is very a much a function of the current operating point. I
think latency for sleep states is the same every time. Also which direction are you capturing latency for, suspend or resume? If your power manager is making decisions based on latency, I could imagine that it needs to know the latency for going into and out of that state.
---
Well, you could also argue that the ability to express latency is a good argument for having an approach that does mingle frequency-based,
voltage-based, and sleep-state Ops, though not necessarily exactly what oppoint does! That is, if the policy manager is to make good decisions about whether to shift to a different frequency or sleep at one of n possible sleep levels, it would exactly want to be able to consider the alternatives in terms of the expected time and power cost of each possible transition and whether the expected time to remain in that state would be sufficient to recoup those costs.
That is, you'd like a big state-transition table that has a tuple of costs associated with each possible transition from each possible state.
The utility of the expected times, of course, depends on whether you are able to infer anything about how long an idle (or low-work) period is likely to persist. I think this is a fertile area for experimentation, though we haven't had time to do it, yet. And, while it's superficially easier to take on for embedded devices that have limited numbers of states, the notion of a system manager that watches work patterns and their corresponding load levels and idle times is not particularly far-fetched.
On the other hand, getting infrastructure in place is more important, today! But, that said, if user-space interfaces are forever, you would like to present a user-space interface that can be easily extended to support such notions in the future, without breaking compatibility.
Scott
Quoted 10 lines · David Singleton
Quoted 9 lines · Pavel Machek
Hi!
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
/sys/power/operating_points/high
/sys/power/operating_points/highest
/sys/power/operating_points/low
/sys/power/operating_points/lowest
/sys/power/operating_points/medium
/sys/power/operating_points/mem
/sys/power/operating_points/standby
....
Quoted 9 lines
Quoted 1 line
That does not make mixing them right.
Both OpPoint and PowerOp are going to 'mix' frequency, voltage and sleep states into their operating point concepts.
The point was not to make it look like I was mixing sleep states and CPU frequency states, but to present all the power states supported by the system in one place and with one interface. It simplifies not only kernel code, but power manager code as well.
It is also wrong. And no, I do not think your power manager can properly use "mem" state.
You see, "mem" is very different from lowest. To exit lowest, you have to "echo highest > state". To exit "mem", you need power button. That's very different operation.
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Perhaps, but the common name space makes it easy for the power manager
daemon to perform the same functions without having to know that the lowest
speed on my laptop is 600Mhz.
Quoted 8 lines
Quoted 2 lines
And enumerate english strings in power daemon? Limiting the numver of states?
Hah, I didn't think of it that way. I was thinking in the same way
"mem" and "disk" and "standy" are strings in the kernel.The names themselves don't mean anything other than to imply an order so the kernel and power manager can understand the same order.
mem/disk/standby are strings, because they can not be easily turned into numbers. "low"/"lowest"/"high"/"highest" mess can easily be turned into numbers. And that's what cpufreq does, btw.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 4 lines · David Singleton
The patchset and rpmsl are available at:
Care to put up a tarball for those of us running on distros that are not RPM based?
thanks,
greg k-h
Quoted 8 lines · Greg KH
Quoted 4 lines · David Singleton
The patchset and rpmsl are available at:
Care to put up a tarball for those of us running on distros that are not RPM based?
Okay, there is tarball, patches and spec file in
http://source.mvista.com/~dsingleton/2.6.18-rc4/oppointd
David
Quoted 5 lines
thanks,
greg k-h
2006/8/26, David Singleton <[email protected]>:
Quoted 21 lines · Dave Jones
Quoted 19 lines · David Singleton
Quoted 6 lines
If I had all the existing cpufreq tables transformed into operating points I could make a patch that would remove the bulk of cpufreq code from the kernel and you'd have pretty much the same functionality without the maintenance issues the added layers and complexity bring.
If this is going to fly at all, I think thats where we need to be headed. Having two parts of the kernel doing the same thing just seems very wrong to me.
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
[snip]
Quoted 3 lines
1) I believe I now have the right kernel interface for a common power management infrastructure.
OpPoint continues to focus on user space interface development for power management in contrast to that there seem to be an agreemment in the comunity to defer this integration due to in fact quite a lot of open/undiscussed and complex questions about this integration and instead to focus on getting a consensus on operating point structure definition and methods to work with the structure instances.
OpPoint continues to focus on integration with CPUFreq in a manner which was outlined as an anacceptable during recent discussions on the list - removing the concept of a inkernel governor and most of the CPUFreq feature code.
OpPoint continues to develop userspace interfaces and integration based on operating point definition for which Matt and I posted issues/questions several time and the posts have been left without a reply.
Below I'm trying to summurize all issues I see with OpPoint approach sometimes using terms defined in PowerOP approach (for example layer names).
'struct powerop' definition
------------------------------------
- frequency, voltage fields are arch specific: not to mention any complex embedded case but current definition and OpPoint implementation does not work even for x86 SMP case.
- latency is not an attribute of a certain operating point but a function of two arguments - current operating point and a point we are goint to switch to. Therefor latency just does not belong to 'struct powerop'
- all hooks are redundant: the hooks are the same for all operating points untill we come to the integration with suspend/resume. But we believe the intagration needs more investigation at the first place and at the second we feel like the integration may be handled on PM Core layer instead of having per operating point hooks
- prepare_transition and finish_ransition may be moved even below PM Core to clock/voltage framework; needs more carefull investigation though
- md_data has an issue from OO design paradigm perspective. OpPoint requires an entity above PowerOP to know internals of arch md_data (see centrino-dynamic-powerop.c implementation) and thus requires an arch dependent header file to be included in the code which can be impemented in arch independent manner. That would be fine if there was no solution to achieve required functionality without such a hack but PowerOP provides such approach by dereferencing power parameters by name. File which implements operating points registration in PowerOP approach does not include any header file from include/asm-* subtrees.
All further pieces porposed by OpPOint base on the above incorrect design of the main structure and therefore have issues.
integration with suspend/resume
-------------------------------
- mixing system state and operating point concept (different points may correspond to a sleep/standby system state)
- legacy PM states are redefined via new OpPOint interface but do not use it (explicit 'if' statements in legacy pm code instead of OpPOint hooks uilization)
- names for operating points presented in the original letter below implicitly assumed the points are ranged by some order (now it is from the highest [power comsumption] to the lowest. However having many more power parameters than just one freq and one voltage does not allow to range the points in such a way and a string name without knowledge of a particular power parameter values is not sufficient (even in x86 SMP case: not to mention it's hard to me to express SMP case in current OpPOint terms but what are names and how to distinguish/range 2 CPUs system states corresponded to 'highest point for CPU0 + medium for CPU1' against 'low for CPU0 + high for CPU1' ?)
- no example of (at least optional) capability to export information about particular power paramenter is presented while it was obviously highlighted by embedded community that it is a must
- direct utilization of PM internal structure 'pm_state' instead of an attempt of an API
cpufreq core and a cpufreq driver/OpPOint integration
-------------------------------
- integration with legacy cpufreq interface is completely missing in both arch (x86 and pxa) examples. If OpOint was a universal approach it would allow to build different interfaces on top of it. In this case you can porpose more optimized/improved interface if you feel existed interface has issues leaving existed interface as a [configurable] option and remove it when agreed.
- while clear desgin and interfaces are outlined for so called PM Core layer by PowerOP approach this layer is not addressed by OpPoints in any way
- a cpufreq driver still should contains code to access arch hardware while the functionality of cpufreq driver falls into PM Core layer and there is no longer reason to have the functionality related to cpufreq concept
- no any integration with clock/voltage framework. Integral solution which includes Clock/voltage framework just saves more power [period].
x86 cpufreq/OpPoint integration
-------------------------------
- struct powerop hooks are expected to be arch specific but intialized by some cpufreq core routines
- cpufreq driver still shares cpufreq core cpufreq_frequncy_table structure
- integration with legacy cpufreq interface is completely missing
- OpPoint design does not handle SMP case.
PowerOP addresses all the issues mentioned above and works for SMP case. Integration with legacy kernel PM code (including constraints and standalone driver suspend/resume) and a certain userspace interface (basically which can be any having current PowerOP interface underneath) are the next steps for PowerOP approach once the correct brick of PowerOP layer is in place.
Eugeny
Hi!
Okay, I never liked opPoint framework... so your critism seems okay, but do your patches really solve all the points you raised?
Quoted 3 lines · Eugeny S. Mints
2006/8/26, David Singleton <[email protected]>:
Quoted 2 lines · Dave Jones
Quoted 1 line · David Singleton
...
Quoted 6 lines
Quoted 2 lines
1) I believe I now have the right kernel interface for a common power management infrastructure.
-
md_datahas an issue from OO design paradigm perspective. OpPoint requires an entity above PowerOP to know internals of archmd_data(seecentrino-dynamic-powerop.cimplementation) and thus requires an arch
Is that what you were trying to solve with string parsing?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
2006/8/29, Pavel Machek <[email protected]>:
Quoted 4 lines
Hi!
Okay, I never liked opPoint framework... so your critism seems okay, but do your patches really solve all the points you raised?
it's hard to catch up in this way until people start to comment out the [patches] code. I haven;t seen any comments on my code except those Greg made. I'm working to address Greg's comments.
Quoted 6 lines · Eugeny S. Mints
Quoted 3 lines
2006/8/26, David Singleton <[email protected]>:
Quoted 2 lines · Dave Jones
Quoted 1 line · David Singleton
...
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
1) I believe I now have the right kernel interface for a common power management infrastructure.
-
md_datahas an issue from OO design paradigm perspective. OpPoint requires an entity above PowerOP to know internals of archmd_data(seecentrino-dynamic-powerop.cimplementation) and thus requires an archIs that what you were trying to solve with string parsing?
Exactly. The parsing is result of PowerOP patches evolution from exporting 'struct powerop_point' through 'void *' upto string parsing. 'void *' approach would be fine if we agreed to have all instances manipulating on points via sysfs/configfs interface. But the requirement on inkernel operating points registration modules which came from the discussions on the list still persists. For example cpufreq needs such inkernel registration module. String parsing comes to the scene to register power parameters without inclusion of an arch header file.
OpPoint has not such header file included in the registration module x86 code just because OpPoint has wrong definition of operating point with some unknown frequency and voltage fields in 'struct oppoint' while the fields must be defined in arch dependent part of the code.
I'm still pondering about approach to have parsing only in powerop core layer according to your comments, btw.
Eugeny
Quoted 5 lines
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 26 lines · Eugeny S. Mints
2006/8/26, David Singleton <[email protected]>:
Quoted 21 lines · Dave Jones
Quoted 19 lines · David Singleton
Quoted 6 lines
If I had all the existing cpufreq tables transformed into operating points I could make a patch that would remove the bulk of cpufreq code from the kernel and you'd have pretty much the same functionality without the maintenance issues the added layers and complexity bring.
If this is going to fly at all, I think thats where we need to be headed. Having two parts of the kernel doing the same thing just seems very wrong to me.
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
[snip]
Quoted 3 lines
1) I believe I now have the right kernel interface for a common power management infrastructure.
Quoted 6 lines
OpPoint continues to focus on user space interface development for power management in contrast to that there seem to be an agreemment in the comunity to defer this integration due to in fact quite a lot of open/undiscussed and complex questions about this integration and instead to focus on getting a consensus on operating point structure definition and methods to work with the structure instances.
Actually OpPoint is focusing on all the interfaces, user-kernel, kernel-architecture
independent - power management interfaces, and power management framework - architecture/platform specific interfaces.
Quoted 5 lines
OpPoint continues to focus on integration with CPUFreq in a manner which was outlined as an anacceptable during recent discussions on the list - removing the concept of a inkernel governor and most of the CPUFreq feature code.
The point of OpPoint is to show that a unified power management infrastructure is possible and that bolting on another power management infrastructure to the kernel is not the right approach.
OpPoint is not trying to replace cpufreq. It's trying to unify all the power management
infrastructures into a a single infrastructure. OpPoint uses the cpufreq notifier
infrastructure to do both operating opoint transition and driver scaling notification,
and it performs the same basic functions as cpufreq, without the policy and governor
code. It is also performing all the same Dynamic Power Management functionality on the pxa27x mainstone. The point is one infrastructure can support them.
And with the new oppointd power daemon it is performing all the same functions as cpuspeed did on my laptop, just with a lot less code in the kernel.
Quoted 5 lines
OpPoint continues to develop userspace interfaces and integration based on operating point definition for which Matt and I posted issues/questions several time and the posts have been left without a reply.
Sorry, I'm having a hard time keeping up with all the email threads.
Quoted 10 lines
Below I'm trying to summurize all issues I see with OpPoint approach sometimes using terms defined in PowerOP approach (for example layer names).
'struct powerop' definition
------------------------------------
- frequency, voltage fields are arch specific: not to mention any complex embedded case but current definition and OpPoint implementation does not work even for x86 SMP case.
Actually frequency, voltage and latency fields are architecture independent and a necessary peice of information that any power manager must have.
You are right, I have not yet put in the additional layer to support SMP systems. That is one of the pieces I'm still working on.
Quoted 4 lines
- latency is not an attribute of a certain operating point but a function of two arguments - current operating point and a point we are goint to switch to. Therefor latency just does not belong to 'struct powerop'
I disagree.
Quoted 6 lines
- all hooks are redundant: the hooks are the same for all operating points untill we come to the integration with suspend/resume. But we believe the intagration needs more investigation at the first place and at the second we feel like the integration may be handled on PM Core layer instead of having per operating point hooks
The hooks are not redundant nor the same for all operating points. Each operating point defines it's prepare, transition, and finish functions for the hooks. And different types of operating points may have completely different functions in those hooks, on the same platform.
Quoted 3 lines
-
prepare_transitionandfinish_ransitionmay be moved even below PM Core to clock/voltage framework; needs more carefull investigation though
I disagree. Both the pm suspend and cpufreq code has them in exactly the same place.
Quoted 10 lines
-
md_datahas an issue from OO design paradigm perspective. OpPoint requires an entity above PowerOP to know internals of archmd_data(seecentrino-dynamic-powerop.cimplementation) and thus requires an arch dependent header file to be included in the code which can be impemented in arch independent manner. That would be fine if there was no solution to achieve required functionality without such a hack but PowerOP provides such approach by dereferencing power parameters by name. File which implements operating points registration in PowerOP approach does not include any header file frominclude/asm-*subtrees.
No, the md_data is the opaque pointer into architecture dependent data. The power management infrastructure doens't need to know what data is linked into md_data, just as drivers have driver specific structs that are opaque to the upper layers of software.
Quoted 3 lines
All further pieces porposed by OpPOint base on the above incorrect design of the main structure and therefore have issues.
wow.
Quoted 5 lines
integration with suspend/resume
-------------------------------
- mixing system state and operating point concept (different points may correspond to a sleep/standby system state)
The pxa27x code shows that indeed there are more than one suspsend state, which is why the operating point model works so well on both my centrino laptop and my pxa27x mainstone running the same oppointd power daemon.
Quoted 4 lines
- legacy PM states are redefined via new OpPOint interface but do not use it (explicit 'if' statements in legacy pm code instead of OpPOint hooks uilization)
The enter_state code could be merged into the pm_change code, or vice versa, I haven't had time to make it really unified and pretty.
Quoted 7 lines
- names for operating points presented in the original letter below implicitly assumed the points are ranged by some order (now it is from the highest [power comsumption] to the lowest. However having many more power parameters than just one freq and one voltage does not allow to range the points in such a way and a string name without knowledge of a particular power parameter values is not sufficient
That's not quite correct. The ordering of names, lowest to highest, allows the power manager daemon to cover most of the use cases right out of the box. It's performing the same functions on both my centrino laptop and the pxa27x mainstone right now without any changes to either the power manager or power managenment config file.
One of the next boards I'm working on has different operating points at the same frequency, but different voltages. All that is realy required to support this a plugin to the power manager that understand the different operating points so it can best choose when to transition to each point.
Custom plugins to a power manager that lets the power manager deal with the unique set of operating points on a particular platform is one of the really attractive parts of OpPoint. It won't have to be woven into the kernel.
Quoted 4 lines
(even in x86 SMP case: not to mention it's hard to me to express SMP case in current OpPOint terms but what are names and how to distinguish/range 2 CPUs system states corresponded to 'highest point for CPU0 + medium for CPU1' against 'low for CPU0 + high for CPU1' ?)
I'm still working on the SMP case. It's not that I'm ignoring it. Give me a few more days.
Quoted 4 lines
- no example of (at least optional) capability to export information about particular power paramenter is presented while it was obviously highlighted by embedded community that it is a must
Which parameters besides frequency, voltage and latency are required to be exported to the power manager?
Quoted 4 lines
- direct utilization of PM internal structure '
pm_state' instead of an attempt of an API
Quoted 8 lines
cpufreq core and a cpufreq driver/OpPOint integration
-------------------------------
- integration with legacy cpufreq interface is completely missing in both arch (x86 and pxa) examples. If OpOint was a universal approach it would allow to build different interfaces on top of it. In this case you can porpose more optimized/improved interface if you feel existed interface has issues leaving existed interface as a [configurable] option and remove it when agreed.
I'm sorry, I don't understand that statement. I'm still opposed to dynamic-on-the-fly construction of operating points. It's really dangerous. The hardware vendors want it so that new hardware doesn't have to wait for software before they can sell it.
The cpufreq structure of defining and validating operating points before being integrated into the kernel is the correct way to do it, in my opinion.
Quoted 4 lines
- while clear desgin and interfaces are outlined for so called PM Core layer by PowerOP approach this layer is not addressed by OpPoints in any way
correct. They are a different design.
Quoted 5 lines
- a cpufreq driver still should contains code to access arch hardware while the functionality of cpufreq driver falls into PM Core layer and there is no longer reason to have the functionality related to cpufreq concept
Is this a statement about PowerOP? OpPoint doesn't use the PowerOp PM Core layer definition. OpPoint only has 3 layers:
1) user space power manager and user-kernel interace.
2) architecture independent layer between the kernel and the power managment infrastructure.
3) The architecture dependent layer that does the work and has to touch all the hardware. The architecture dependent layer is the piece where where the hardware specific operating points and functions to transition to the operating points are defined.
This is also why it's so simple to add new architecture and platform support.
All that is needed is the architecture dependent portion to support a new platform.
Quoted 3 lines
- no any integration with clock/voltage framework. Integral solution which includes Clock/voltage framework just saves more power [period].
No so. The mainstone uses the existing <linux/clk.h> clock framework, and it must
since it supports so many different clocks to transition to a new operating point.
I'm still open to integrate with any new voltage framework, I just haven't seen it yet.
I also don't believe it will be a problem integrating with voltage framework. The
voltage framework will be needed by the architecture dependent pieces of power management and a common voltage framework will just make it easier.
Quoted 7 lines
x86 cpufreq/OpPoint integration
-------------------------------
- struct powerop hooks are expected to be arch specific but intialized by some cpufreq core routines- cpufreq driver still shares cpufreq core
cpufreq_frequncy_tablestructure
Correct, the cpu_frq table structure is the piece that gets the gets the frequency
and voltage right. I'm not changing operating points definition for
the existing processor line. I'm just simplifying the transition to
and from the existing system states.
Quoted 2 lines
- integration with legacy cpufreq interface is completely missing
Not quite. Once the operating points are constructed, from the same validated data, the oppointd daemon can perform the
same legacy cpufreq functionality. Governor and policy code moves out of the kernel into the power manager. It integrates through the same cpufreq table data, the same cpufreq notifier lists for transitioning and scaling drivers, and moves policy management code out of
the kernel into the power daemon.
Quoted 9 lines
- OpPoint design does not handle SMP case.
PowerOP addresses all the issues mentioned above and works for SMP case. Integration with legacy kernel PM code (including constraints and standalone driver suspend/resume) and a certain userspace interface (basically which can be any having current PowerOP interface underneath) are the next steps for PowerOP approach once the correct brick of PowerOP layer is in place.
It does?
David
Quoted 3 lines
Eugeny
2006/8/29, David Singleton <[email protected]>:
Quoted 34 lines · Eugeny S. Mints
Quoted 26 lines
2006/8/26, David Singleton <[email protected]>:
Quoted 21 lines · Dave Jones
Quoted 19 lines · David Singleton
Quoted 6 lines
If I had all the existing cpufreq tables transformed into operating points I could make a patch that would remove the bulk of cpufreq code from the kernel and you'd have pretty much the same functionality without the maintenance issues the added layers and complexity bring.
If this is going to fly at all, I think thats where we need to be headed. Having two parts of the kernel doing the same thing just seems very wrong to me.
The other alternative as suggested earlier this week would be archictures getting to 'opt out' of powerop for their cpufreq drivers where it doesn't necessarily bring anything but the layer of indirection.
I'm about to disappear for two weeks for a much needed vacation, but I'll be interested to see other folks comments/opinions on this when I get back.
[snip]
Quoted 3 lines
1) I believe I now have the right kernel interface for a common power management infrastructure.
Quoted 6 lines
OpPoint continues to focus on user space interface development for power management in contrast to that there seem to be an agreemment in the comunity to defer this integration due to in fact quite a lot of open/undiscussed and complex questions about this integration and instead to focus on getting a consensus on operating point structure definition and methods to work with the structure instances.
Quoted 5 lines
Actually OpPoint is focusing on all the interfaces, user-kernel, kernel-architecture
independent - power management interfaces, and power management framework -
architecture/platform specific interfaces.
you've dug into all complex set of interfaces without having community convinced you put correct main brick (struct oppoint definition) in the basis. That's fine to provide reference code for other pieces as example how you expect your oppoint to work but you keep to enchance other interface despite there are unresovled questions with struct oppoint definition even based on your initial draft of overall picture.
Quoted 10 lines
Quoted 6 lines
OpPoint continues to focus on integration with CPUFreq in a manner which was outlined as an anacceptable during recent discussions on the list - removing the concept of a inkernel governor and most of the CPUFreq feature code.
The point of OpPoint is to show that a unified power management infrastructure is possible and that bolting on another power management infrastructure to the kernel is not the right approach.
Just not true. The patch set which corresponds to what you are saying here should remove cpufreq code completely while in your patch set you just added something without touching legacy cpufreq code in any way what is completely confusing.
PowerOP is much more flexible solution: it provides an option to build sysfs interface identical to your sysfs interface (even enchanced sysfs interface with export of power parameters and points creation capability) _and_ an option to build legacy cpufreq interface on top of PowerOP . One can build what is more suitable for a particular system design on top of PowerOP - that is the real university.
Quoted 12 lines
OpPoint is not trying to replace cpufreq. It's trying to unify all the power management
infrastructures into a a single infrastructure. OpPoint uses the cpufreq notifier
infrastructure to do both operating opoint transition and driver scaling notification,
and it performs the same basic functions as cpufreq, without the policy and governor
code. It is also performing all the same Dynamic Power Management functionality on the pxa27x mainstone. The point is one infrastructure can support them.
Quoted 2 lines
And with the new oppointd power daemon it is performing all the same functions as cpuspeed did on my laptop, just with a lot less code in the kernel.
Please publish your measured latencies _with proper system load_ for inkerenel cpufreq governor and your userspace deamon so everyone can see it's really the same.
Quoted 15 lines
Quoted 7 lines
OpPoint continues to develop userspace interfaces and integration based on operating point definition for which Matt and I posted issues/questions several time and the posts have been left without a reply.
Sorry, I'm having a hard time keeping up with all the email threads.
Quoted 5 lines
Below I'm trying to summurize all issues I see with OpPoint approach sometimes using terms defined in PowerOP approach (for example layer names).
Quoted 8 lines
Quoted 5 lines
'struct powerop' definition
------------------------------------
- frequency, voltage fields are arch specific: not to mention any complex embedded case but current definition and OpPoint implementation does not work even for x86 SMP case.Actually frequency, voltage and latency fields are architecture independent and a necessary peice of information that any power manager must have.
there can be a platfrom where power parameters are deviders. no any frequency and voltage. these _are_ arch dependent.
Quoted 2 lines
You are right, I have not yet put in the additional layer to support SMP systems. That is one of the pieces I'm still working on.
until there is no SMP code your definition of 'struct oppoint' is wrong due to my SMP and right above comment.
Quoted 6 lines
Quoted 4 lines
- latency is not an attribute of a certain operating point but a function of two arguments - current operating point and a point we are goint to switch to. Therefor latency just does not belong to 'struct powerop'
I disagree.
any arguments?
Quoted 8 lines
Quoted 7 lines
- all hooks are redundant: the hooks are the same for all operating points untill we come to the integration with suspend/resume. But we believe the intagration needs more investigation at the first place and at the second we feel like the integration may be handled on PM Core layer instead of having per operating point hooks
Quoted 4 lines
The hooks are not redundant nor the same for all operating points. Each operating point defines it's prepare, transition, and finish functions for the hooks. And different types of operating points may have completely different functions in those hooks, on the same platform.
please point out lines in your patch set to see this. in the code i saw all the hooks are the same so far.
Quoted 7 lines
Quoted 3 lines
-
prepare_transitionandfinish_ransitionmay be moved even below PM Core to clock/voltage framework; needs more carefull investigation thoughI disagree. Both the pm suspend and cpufreq code has them in exactly the same place.
"it's been implemented in this way for ages so it's the only right way" argument. i do not buy it.
Quoted 12 lines
Quoted 11 lines
-
md_datahas an issue from OO design paradigm perspective. OpPoint requires an entity above PowerOP to know internals of archmd_data(seecentrino-dynamic-powerop.cimplementation) and thus requires an arch dependent header file to be included in the code which can be impemented in arch independent manner. That would be fine if there was no solution to achieve required functionality without such a hack but PowerOP provides such approach by dereferencing power parameters by name. File which implements operating points registration in PowerOP approach does not include any header file frominclude/asm-*subtrees.
Quoted 4 lines
No, the
md_datais the opaque pointer into architecture dependent data. The power management infrastructure doens't need to know what data is linked intomd_data, just as drivers have driver specific structs that are opaque to the upper layers of software.
no reasons to discuss this until we are done discussing 'struct oppoint' definition.
Quoted 60 lines
Quoted 4 lines
All further pieces porposed by OpPOint base on the above incorrect design of the main structure and therefore have issues.
wow.
Quoted 5 lines
integration with suspend/resume
-------------------------------
- mixing system state and operating point concept (different points may correspond to a sleep/standby system state)The pxa27x code shows that indeed there are more than one suspsend state, which is why the operating point model works so well on both my centrino laptop and my pxa27x mainstone running the same oppointd power daemon.
Quoted 4 lines
- legacy PM states are redefined via new OpPOint interface but do not use it (explicit 'if' statements in legacy pm code instead of OpPOint hooks uilization)
The
enter_statecode could be merged into thepm_changecode, or vice versa, I haven't had time to make it really unified and pretty.Quoted 7 lines
- names for operating points presented in the original letter below implicitly assumed the points are ranged by some order (now it is from the highest [power comsumption] to the lowest. However having many more power parameters than just one freq and one voltage does not allow to range the points in such a way and a string name without knowledge of a particular power parameter values is not sufficient
That's not quite correct. The ordering of names, lowest to highest, allows the power manager daemon to cover most of the use cases right out of the box. It's performing the same functions on both my centrino laptop and the pxa27x mainstone right now without any changes to either the power manager or power managenment config file.
One of the next boards I'm working on has different operating points at the same frequency, but different voltages. All that is realy required to support this a plugin to the power manager that understand the different operating points so it can best choose when to transition to each point.
Custom plugins to a power manager that lets the power manager deal with the unique set of operating points on a particular platform is one of the really attractive parts of OpPoint. It won't have to be woven into the kernel.
Quoted 4 lines
(even in x86 SMP case: not to mention it's hard to me to express SMP case in current OpPOint terms but what are names and how to distinguish/range 2 CPUs system states corresponded to 'highest point for CPU0 + medium for CPU1' against 'low for CPU0 + high for CPU1' ?)
I'm still working on the SMP case. It's not that I'm ignoring it. Give me a few more days.
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
- no example of (at least optional) capability to export information about particular power paramenter is presented while it was obviously highlighted by embedded community that it is a must
Which parameters besides frequency, voltage and latency are required to be exported to the power manager?
basically all available platform power parameters. let userspace app to decide to use it or not. Tell me please what are frequency, voltage and latency for omap1710?
Quoted 13 lines
Quoted 4 lines
- direct utilization of PM internal structure '
pm_state' instead of an attempt of an APIQuoted 8 lines
cpufreq core and a cpufreq driver/OpPOint integration
-------------------------------
- integration with legacy cpufreq interface is completely missing in both arch (x86 and pxa) examples. If OpOint was a universal approach it would allow to build different interfaces on top of it. In this case you can porpose more optimized/improved interface if you feel existed interface has issues leaving existed interface as a [configurable] option and remove it when agreed.
Quoted 4 lines
I'm sorry, I don't understand that statement. I'm still opposed to dynamic-on-the-fly construction of operating points. It's really dangerous. The hardware vendors want it so that new hardware doesn't have to wait for software before they can sell it.
PowerOP has dynamic-on-the-fly construction of operating points capability but provides completely the same "safe" interface for cpufreq feature users. Where is a danger?
Quoted 3 lines
The cpufreq structure of defining and validating operating points before being integrated into the kernel is the correct way to do it, in my opinion.
please take a look at CpuFreq PwerOP inegration patch set and comment the code if you see any problems.
Quoted 2 lines
Quoted 2 lines
- OpPoint design does not handle SMP case.
[snip]
Quoted 9 lines
Quoted 7 lines
PowerOP addresses all the issues mentioned above and works for SMP case. Integration with legacy kernel PM code (including constraints and standalone driver suspend/resume) and a certain userspace interface (basically which can be any having current PowerOP interface underneath) are the next steps for PowerOP approach once the correct brick of PowerOP layer is in place.
It does?
please comment the code if any issues.
Eugeny
Quoted 7 lines
David
Quoted 3 lines
Eugeny
Quoted 7 lines · ext David Singleton
Quoted 2 lines
- latency is not an attribute of a certain operating point but a
function of
Quoted 2 lines
two arguments - current operating point and a point we are goint to switch to. Therefor latency just does not belong to 'struct powerop'
I disagree.
Problem is that you disagree without giving your reasons. Here is another reason putting latency into your operating point definition isn't going to fly:
http://lwn.net/Articles/196900/ <--- An API for specifying latency constraints
http://lwn.net/Articles/197282/
Please comment on PowerOP patches; dissect them if need be on why you don't agree with the approach.
Regards,
Amit
Signature · 2 lines
Amit Kucheria <[email protected]> Nokia
Quoted 12 lines
[mailto:[email protected]] On Behalf Of Amit Kucheria
Quoted 4 lines
Quoted 2 lines
- latency is not an attribute of a certain operating point but a
function of
Quoted 1 line
two arguments - current operating point and a point we
are goint to
Quoted 1 line
Quoted 1 line
switch to. Therefor latency just does not belong to
'struct powerop'
Quoted 2 lines
I disagree.
Quoted 8 lines
Problem is that you disagree without giving your reasons. Here is another reason putting latency into your operating point definition isn't going to fly:
http://lwn.net/Articles/196900/ <--- An API for specifying latency constraints
---
Actually, the proposed acceptable_latency functions just make it more useful to add latency information to the operating point definitions. The new interfaces set a [global] acceptable latency, the operating point attribute would define the maximum latency that could occur for a particular OP or sleep mode. You need both sides - you need to know what's an acceptable latency and you need to know what latency a particular operation (like transitioning to a different OP) will impose; then you can decide whether a particular transition can be made while still meeting the required latency.
So, if a driver had set acceptable_latency to 300ms, the Power-Management policy manager could look at the range of available Ops and pick the lowest-power OP that met the expected load and would also meet the required latency guarantee. [And note that the acceptable latency has to include both the resume time and whatever part of suspend happens with interrupts blocked and can't be aborted.]
I like this new facility a lot. Now we just need something similar for expressing anticipated required processing capacity ("I need n thousand instructions executed in the next s seconds") in a nice platform-independent way...
Scott
Quoted 21 lines · ext Preece Scott-PREECE
Quoted 12 lines
[mailto:[email protected]] On Behalf Of Amit Kucheria
Quoted 4 lines
Quoted 2 lines
- latency is not an attribute of a certain operating point but a
function of
Quoted 1 line
two arguments - current operating point and a point we
are goint to
Quoted 1 line
Quoted 1 line
switch to. Therefor latency just does not belong to
'struct powerop'
Quoted 2 lines
I disagree.
Quoted 8 lines
Problem is that you disagree without giving your reasons. Here is another reason putting latency into your operating point definition isn't going to fly:
http://lwn.net/Articles/196900/ <--- An API for specifying latency constraints
---
<snip>
Quoted 7 lines
So, if a driver had set
acceptable_latencyto 300ms, the Power-Management policy manager could look at the range of available Ops and pick the lowest-power OP that met the expected load and would also meet the required latency guarantee. [And note that the acceptable latency has to include both the resume time and whatever part of suspend happens with interrupts blocked and can't be aborted.]
Thinking of it that way, latency is possibly useful. Needs more thinking. But what latency values are associated with the OP? The values from the spec sheet provided by the silicon vendor do not take into account the other operations necessary before you can safely switch to a new OP. Some of these operations require indeterminate amount of time.
Quoted 4 lines
I like this new facility a lot. Now we just need something similar for expressing anticipated required processing capacity ("I need n thousand instructions executed in the next s seconds") in a nice platform-independent way...
bogomips? :-D
Signature · 2 lines
Amit Kucheria <[email protected]> Nokia
Hi,
Quoted 2 lines · Matthew Locke
I am a little concerned that none of the cpufreq developers have responded. I was hoping to get their feedback.
Graduating from one law school, moving to the US, and adapting to another law school proved to be quite time-consuming for me, but I hope to get back to linux-related things within this and the next week -- so please excuse my delay so far...
Thanks,
Dominik
Dominik,
Quoted 6 lines · Dominik Brodowski
Hi,
Quoted 2 lines · Matthew Locke
I am a little concerned that none of the cpufreq developers have responded. I was hoping to get their feedback.
Quoted 7 lines
Graduating from one law school, moving to the US, and adapting to another law
school proved to be quite time-consuming for me, but I hope to get back to
linux-related things within this and the next week -- so please excuse my
delay so far...
I hope the transition is happening smoothly. Looking forward to your comments when you have time.
Quoted 4 lines
Thanks,
Dominik