An embedded-Linux power-management framework
An embedded-Linux power-management framework
============================================
A dynamic power management framework for Linux is necessary to support the flexible and aggressive power management policies made possible by the new class of dynamic voltage- and frequency-scalable embedded processors including the IBM PowerPC 405LP and the Intel XScale PXA210 and PXA250.
We have recently started work in this and would appreciated feedback on the direction we are headed, summarized as a set of requirements below. Once we have a start at a specification and some code we will put everything on Sourceforge as an Open Source project. Please let us know what you think!
Requirements
============
Since CPU power typically increases as the cube of voltage while CPU frequency scales linearly with voltage, very significant power savings can be achieved by selecting the correct operating point for the current application set. For example, playing an MP3 with madplay only takes about 30 Mhz of the 405LP CPU. By running the system at the lowest operating point sufficient to play the MP3 (100 MHz @ 1.0 V) vs. the highest possible operating point (266 MHz @ 1.8 V) an immediate system power reduction (CPU + memory) of 40% is realized. Since the 405LP can scale CPU and bus frequencies with an OS overhead in the tens of microseconds, it also makes sense to scale back the CPU and bus during idle. The power reduction between idling at 33 MHz and 100 Mhz is about 20% in one system, and is significant because scaling back the bus frequency also reduces the SDRAM power. The low overhead required to do this scaling means we can achieve these power savings without impacting interrupt response time too much. Even with more power-hungry applications like MPEG-4 playback, on the 405LP we've found that voltage- and frequency-scaling the system to a low-power state during the inter-frame gaps (i.e. 30 times per second) can reduce system power consumption (extends battery life) by 10%, and has no visible impact on the video playback.
In addition, devices using these newer processors continue to support the traditional static power management using sleep, hibernate, (etc.) power-saving states.
In summary, the requirements for a Linux power-management framework are:
1. Support dynamic power management by taking advantage of the dynamic scaling capabilities of new hardware.
2. Support traditional static power management.
3. Both static and dynamic power management need to be supported with a Linux-specific, BIOS-independent, architecture-independent design. This consolidated design must account for interactions between static and dynamic power management.
4. Support embedded systems with uni-processors and symmetric or asymmetric multiprocessors.
5. Support pluggable power management policies. This allows end-users to install applications that benefit from unique power policies and supports the following requirement.
6. Allow applications to both choose and provide hints to power policies.
Thanks!
From:
Hollis Blanchard <[email protected]> (IBM) Bishop Brock <bcbrock-r/[email protected]> (IBM) Matthew Locke <[email protected]> (MontaVista) Mark Orvek <[email protected]> (MontaVista) Robert Paulsen <rpaulsen-r/[email protected]> (IBM) Karthick Rajamani <karthick-r/[email protected]> (IBM)
Signature · 8 lines
Robert C. Paulsen, Jr. robert-J3gkRE/[email protected] ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
Quoted 5 lines · Alan Cox
Take a look at cpufreq. The processor speed/voltage side is a solved problem with working code for x86 and ARM processors including the framework to adjust other devices. For example on ARM you have to frob with the RAM clocks. Cpufreq deals with it nicely both from user and kernel sides
cpufreq seems entirely aimed at CPU frequency control. Lowering your frequency will linearly decrease power, but will also linearly extend the duration of your task. Therefore it makes a lot of sense to lower voltage in addition to frequency. Some hardware drivers supported in the cpufreq code already scale down voltage as allowed by frequency reduction.
However, it also makes sense to decrease frequency independent of voltage, since voltage transitions can have higher latency than frequency transitions. The idle task is a great place to lower frequency only, since you're not doing anything anyways (you're not extending the running time of a meaningful task), but you may not want to incur the overhead of a voltage transition every time you come in and out of it.
There are also other frequencies that can affect power consumption, such as PLB (processor local bus) frequency.
There are situations (especially in dedicated-purpose devices running only a few hand-written applications) in which it helps to change some of these values without changing the others. Changing them all according to a single variable (CPU core frequency) could be very limiting. To my knowledge the cpufreq code also does not allow for this flexibility, but certainly it would be nice to add it.
(Perhaps we should continue the thread on linux-pm-devel or cpufreq instead of cross-posting everywhere?)
-Hollis
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Take a look at cpufreq. The processor speed/voltage side is a solved problem with working code for x86 and ARM processors including the framework to adjust other devices. For example on ARM you have to frob with the RAM clocks. Cpufreq deals with it nicely both from user and kernel sides
In terms of per process settings please read US patent 6,298,448.
Suggstions on how t work around it are welcomed
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 6 lines · Hollis Blanchard
There are situations (especially in dedicated-purpose devices running only a few hand-written applications) in which it helps to change some of these values without changing the others. Changing them all according to a single variable (CPU core frequency) could be very limiting. To my knowledge the cpufreq code also does not allow for this flexibility, but certainly it would be nice to add it.
So improve the cpufreq code to be a bit more controllable. Its the right framework. It also needs a littlw tweaking for the cases where we change STPCLK on x86's.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 5 lines · Hollis Blanchard
frequency transitions. The idle task is a great place to lower frequency only, since you're not doing anything anyways (you're not extending the running time of a meaningful task), but you may not want to incur the overhead of a voltage transition every time you come in and out of it.
The idle task should almost never run on a properly power managed system because if we are getting voltage reductions we want to reduce the frequency so that we are not quite idle as that saves us more power than idling. This is also effectively true for clock only scaling because very few of them have a "stopped" mode so their is a ceiling of minimal power consumption we want to rest at as much as possible
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 10 lines · Alan Cox
Quoted 6 lines · Hollis Blanchard
There are situations (especially in dedicated-purpose devices running only a few hand-written applications) in which it helps to change some of these values without changing the others. Changing them all according to a single variable (CPU core frequency) could be very limiting. To my knowledge the cpufreq code also does not allow for this flexibility, but certainly it would be nice to add it.
Quoted 3 lines
So improve the cpufreq code to be a bit more controllable. Its the right framework. It also needs a littlw tweaking for the cases where we change STPCLK on x86's.
Are you sure that cpufreq should be tweaked to manage STPCLK? Would it not make more sence to suck cpufreq into ACPI and call it during Tx (throttling) states if applicable? Of course I realise that might not be allowed by the ACPI spec, but some combination of cqufreq and the Tx states is a good idea... and optional for the user.
--John
--John
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Hi!
Quoted 7 lines
Take a look at cpufreq. The processor speed/voltage side is a solved problem with working code for x86 and ARM processors including the framework to adjust other devices. For example on ARM you have to frob with the RAM clocks. Cpufreq deals with it nicely both from user and kernel sides
In terms of per process settings please read US patent 6,298,448.
Hmm.. like moving outside U.S.? ;-)
[OTOH, IBM might be big enough to buy the pattent and put it in PD or (preferably) prove there was prior work / prove it was trivial and invalidate that.]
Pavel
Signature · 8 lines
Worst form of spam? Adding advertisment signatures ala sourceforge.net. What goes next? Inserting advertisment *into* email? ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf
Quoted 5 lines · Johnathan Hicks
Are you sure that cpufreq should be tweaked to manage STPCLK? Would it not make more sence to suck cpufreq into ACPI and call it during Tx (throttling) states if applicable? Of course I realise that might not be allowed by the ACPI spec, but some combination of cqufreq and the Tx states is a good idea... and optional for the user.
It may make sense on a box with ACPI, but most boxes that are heavily STPCLK managed are older. The Athlon one seems to be less interesting than the others (btw - seems you can mix stpclk with the other features you just have to turn stpclk back off before idling)
On a K5/K6/486/.. STPCLK is basically your entire power management barring what lurks on the PCI devices - which can save a suprising amount of power too. I've been playing (not very successfully at the moment) at dropping my video card into D3 when screenblanking
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Quoted 4 lines · Alan Cox
It may make sense on a box with ACPI, but most boxes that are heavily STPCLK managed are older. The Athlon one seems to be less interesting than the others (btw - seems you can mix stpclk with the other features you just have to turn stpclk back off before idling)
Ah yes, I had forgotten about the older hardware, but I thought all they had was HLT. About the Athlon case, STPCLK is used for all the power management that I can think of except HLT. Feel free to correct me here if I'm wrong.
Quoted 4 lines
On a K5/K6/486/.. STPCLK is basically your entire power management barring what lurks on the PCI devices - which can save a suprising amount of power too. I've been playing (not very successfully at the moment) at dropping my video card into D3 when screenblanking
What kind of delay would that cause when restoring the state of the card? I would hope not that great of a delay as this kind of action is one that should be expected.
--John
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf