Power Management

From COMP15212 Wiki
Depends on Resources

“Power management” – often really energy management, since it is intended to get the best use out of batteries – has become important in the era of truly portable computers. This article gives a brief overview from the software perspective.

Power management is clearly the responsibility of the operating system, since the user will not appreciate the nuances of the system and is unlikely to want to! The basics are to identify the biggest power drains and see what can be done to reduce them.

Although the details may vary, and they are not always truly discrete states, it is illustrative to identify some states which the computer’s components can be in. Here let’s define:

  • Active: working at or near maximum capacity
  • Sleeping: taking a short break
  • Hibernating: A deep sleep for long periods of inactivity
  • Off: what it says

These are listed in descending order of both processing capability and power needs. To move down in this list of states can be quite fast – to go from ‘active’ to ‘off’ might be very quick – but to move up takes longer from further down the list.

Some examples:

Screen

A display back-light is a major power drain. The back-light is often turned off after a short period of inactivity. This can become fully active quite quickly.

Disk drive

A disk-drive motor is a significant power user. A disk drive can hibernate by turning the motor off; the penalty is a longer delay when it is needed again, as the disk needs to be ‘spun up’ to the right speed.

Processor

The processor can be put to sleep when it becomes idle; most modern processors have one or more ‘sleep’ modes. A simple sleep might just stop running instructions (until an interrupt restarts it) and this can react quickly. Hibernation might (for example) involve turning off the cache (which must first be written back to memory before powering down); this incurs a bigger wake-up penalty.

Another approach sometimes used is to reduce the supply voltage to the processor which means it has to process more slowly but the energy demands decrease faster than the processing rate.

Memory

Like the cache, the RAM can be copied to a non-volatile store (e.g. disk) and powered off. The penalty for wake-up from here is quite severe.

Multiprocessors

If there are several processors then not all of them need be powered on at the same time. An example is ARM’s big.LITTLE system which, by default runs code on a simple, energy-efficient processor but turns on a more powerful, more power-hungry processor which takes over the majority of the work if the processing demand rises. It should be easy to imagine how this should operate in a smart-phone, for example.

O.S. role

The power control is a form of I/O as far as the computer is concerned. The policy for deciding what turn on or off, what should be sleeping at any time is clearly a system-level decision, looking at the overall workloads (and, possibly, the current state of the battery) and trying to make future predictions. This is another scheduling task.

Another strategy which is employed is adjusting the processor clock rate. Loosely, the more operations per second a processor does, the hotter it gets (and the faster a battery is drained). It is not unusual to run with a slow clock when there is little work to do and speed this up on demand. Alternatively, temperature sensors may indicate that a part is beginning to overheat and the OS will intervene and run the system more slowly for a while.


Also refer to: Operating System Concepts, 10th Edition: Chapter 12.4.8, pages 514-516