Power Management: Difference between revisions

From COMP15212 Wiki
pc>Yuron
No edit summary
 
gravatar W81054ch [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
m (1 revision imported)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{#set: Priority=3 | Summary=Electrical power management - battery life and cooling
{{#set: Priority=3 | Summary=Electrical power management - battery life and cooling - are the limiting factors in modern computer systems.  Applications programmers don't know (or care) much about this topic so it is up to the OS to maximise operation without melting the chips.}}<!--
- are the limiting factors in modern computer systems.  Applications
programmers don't know (or care) much about this topic so it is up to
the OS to maximise operation without melting the chips.}}<!--
-->{{#invoke:Dependencies|add|Resources,3}}
-->{{#invoke:Dependencies|add|Resources,3}}
“Power management” – often really <em>energy</em> management,
“Power management” – often really <em>energy</em> management, since it is intended to get the best use out of batteries – has
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.
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
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.
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
Although the details may vary, and they are not always truly discrete states, it is illustrative to identify some <em>states</em> which the computer’s components can be in.  Here let’s define:
states, it is illustrative to identify some <em>states</em> which the
computer’s components can be in.  Here let’s define:


*<strong>Active</strong>: working at or near maximum capacity
*<strong>Active</strong>: working at or near maximum capacity
Line 23: Line 13:
*<strong>Off</strong>:  what it says
*<strong>Off</strong>:  what it says


These are listed in descending order of both processing capability and
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.
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:
Some examples:


==== Screen ====
==== Screen ====
A display back-light is a major power drain.  The back-light is often
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.
turned off after a short period of inactivity.  This can become fully
active quite quickly.


==== Disk drive ====
==== Disk drive ====
A disk-drive motor is a significant power user.  A disk drive can
A disk-drive motor is a significant power user.  A disk drive can <em>hibernate</em> 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.
<em>hibernate</em> 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 ====
==== Processor ====
The processor can be put to <em>sleep</em> when it becomes [[idle]]; most
The processor can be put to <em>sleep</em> when it becomes [[idle]]; most modern processors have one or more ‘sleep’ modes.  A
modern processors have one or more ‘sleep’ modes.  A
simple sleep might just stop running instructions (until an [[Interrupts|interrupt]] restarts it) and this can react quickly.
simple sleep might just stop running instructions (until an
<em>Hibernation</em> 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.
[[Interrupts|interrupt]] restarts it) and this can react quickly.
<em>Hibernation</em> 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
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.
processor which means it has to process more slowly but the energy
demands decrease faster than the processing rate.


==== Memory ====
==== Memory ====
Like the cache, the RAM can be copied to a non-volatile store
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.
(e.g. disk) and powered off.  The penalty for wake-up from here is
quite severe.


=== Multiprocessors ===
=== Multiprocessors ===
If there are several processors then not all of them need be powered
If there are several processors then not all of them need be powered on at the same time.  An example is ARM’s
on at the same time.  An example is ARM’s
[https://developer.arm.com/technologies/big-little 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.
[https://developer.arm.com/technologies/big-little 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 ===
=== O.S. role ===
The power control is a form of [[IO|I/O]] as far as the computer is
The power control is a form of [[IO|I/O]] as far as the computer is concerned.  The <em>policy</em> 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 <strong>scheduling</strong> task.
concerned.  The <em>policy</em> 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
<strong>scheduling</strong> task.


Another strategy which is employed is adjusting the processor clock
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.
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.
----
----
 
{{BookChapter|12.4.8|514-516}}
{{PageGraph}}
{{PageGraph}}

Latest revision as of 10:03, 5 August 2019

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