During the past decade, Operating Systems (OSs) for embedded devices have evolved significantly, addressing growing processor complexity and providing a more complete software platform for developing sophisticated applications. Yet power management has remained an afterthought until now. With power efficiency becoming one of the dominant issues facing the electronics industry today, OSs are playing a pivotal role in energy management.
The OS ultimately controls all devices and thus must decide what to shut down and when to do so. But power management raises a number of questions the OS must address. Which devices can be controlled? How much power is saved in the low power states, and does some context have to be saved when going into these states? How long does it take to go back to full power? The answers to these questions vary for each device, so the OS must be able to deal with a range of possibilities.
Consider the following practical scenarios. If the OS shuts down a device and that device is needed again quickly, an annoying delay might occur while it is restarted. On the other hand, if the OS waits too long to shut down a device, energy is wasted for nothing. The objective then is to find algorithms and methods that let the OS make sensible decisions about what to shut down and when.
Reactive power management represents the most basic approach to power management. Today's systems already contain the raw elements of power management. For instance, chip manufacturers have designed power management facilities in their devices for many years. Some are automatic and take little overhead to implement; others need software to manage the system.
However, not all Real-Time OSs (RTOSs) provide the necessary functionality to limit power use. Many embedded OSs are designed to boot the device and enable all the drivers and networking on the board. But when considering lack of power management as a cost, multiplying what it costs to power each device for a year times all the billions of devices in the world quickly results in hundreds of megawatt hours of wasted electricity.
It is evident that systems must become more power savvy, and reactive power management is the initial step to making this possible. Designers must first understand each device's role in the system, its usage life cycle, which other devices relate to it, what control it provides, and how they can minimize its power use by enabling a reactive method.
Implementing reactive power management involves a state machine for every power domain in the system. Power domains are regions of a chip or component that can be controlled to minimize power use. A chip is a power domain if it can be powered down or brought into a lower power state. All devices that are part of that domain are controlled by it. The power manager architecture in Figure 1 illustrates the concept of power domains and events.
If a power domain consists of an Ethernet controller and a USB controller and either one needs the power at full level, then the power domain must be on. But if neither one is using power, it can be powered down.
Additionally, power domains have associations with other devices. A classic example is the LCD and its backlight. Designers can monitor when nothing will be displayed on the LCD and can scale back the power consumed by the backlight by powering it off. But what about the keypad? It must be on at some level and may possibly be on all the time. When someone touches a key, they expect that the backlight that was at half power will be brought to full power. This is a power association.
Devices can have very simple state machines with associated timeouts and will react with an expiring timer to change states. This is reactive power management; power decisions are made based on when the device was last used. Embedded system manufacturers that employ these techniques will immediately see power savings in their devices.
Proactive power management is the notion that designers can predict the future. Of course, this is impossible; however, designers can use complex scheduling techniques to predict what the power use will be when the system is in operation. This data can be discovered manually by programming the system with a power use scenario or by dynamically measuring which domains are active and when.
For example, if a system has 10 tasks and all are ready to run, designers can expect that the system will be busy for a while running these tasks. It makes sense to run the CPU at high power. However, which 10 tasks are running might make a significant difference. If designers can establish that every time a certain task is made ready to run (regardless of it actually being scheduled) the system will increase its power usage; then they can use Dynamic Voltage and Frequency Scaling (DVFS) to provide enough cycles to get the job done without wasting electrons. This demonstrates the reasons why in some cases, it is better to consume a bit more power now so as not to degrade the quality of user experience while waiting for power modes to change.
Ecodesign for a greener tomorrow
Device integrators must take a holistic approach to power conservation, starting with hardware and infrastructure enabled to scale back power use and employing software capable of controlling the device's overall power consumption. Core to this approach is a power-aware OS platform combining both reactive and proactive power management techniques. Manufacturers pursuing more power-efficient devices will benefit their customers by giving them improved battery life, all the while leaving a greener legacy to us all.