power-management.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Mon, 22 Feb 2016 12:41:52 +0200
changeset 1903 901e7394849f
parent 1894 2e3bc2435d68
child 1911 870693ce6ff0
permissions -rw-r--r--
Decrease intent to increase space usage on mobile.

.. -*- coding: utf-8; -*-
.. include:: HEADER.rst

==================
 Power management
==================

* ACPI power states.

  http://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface

** Global states.

 * G0 (S0) Working
 * G1 Sleeping (subdivides into the four states S1 through S4)

   * S1: All processor caches are flushed, and the CPU(s) stop executing
     instructions. Power to the CPU(s) and RAM is maintained; devices that do
     not indicate they must remain on may be powered down.
   * S2: CPU powered off.
   * S3: Commonly referred to as Standby, Sleep, or Suspend to RAM. RAM
     remains powered.
   * S4: Hibernation or Suspend to Disk. All content of main memory is saved
     to non-volatile memory such as a hard drive, and is powered down.
 * G2 (S5) Soft Off. G2, S5, and Soft Off are synonyms. G2 is almost the same
   as G3 Mechanical Off, but some components remain powered so the computer
   can "wake" from input from the keyboard, clock, modem, LAN, or USB device.
 * G3 Mechanical Off: The computer's power consumption approaches close to
   zero, to the point that the power cord can be removed and the system is
   safe for dis-assembly (typically, only the real-time clock is running off
   its own small battery).

** System states.

 * S0 Working (G0), Processor in C0-C3, full context save RAM maintained
 * S1 Sleeping with processor context maintained, RAM maintained
 * S2 Sleeping with processor content not necessarily maintained, RAM
   maintained, most devices in D3
 * S3 Sleeping, lower than S2, RAM maintained, most devices in D3
 * S4 Sleeping, lower than S3, RAM not maintained, most devices in D3
 * S5 Sleeping, lower than S4, no context saved, reboot necessary

** Device states.

 * D0 Fully-On is the operating state.
 * D1 and D2 are intermediate power-states whose definition varies by device.
 * D3 Off has the device powered off and unresponsive to its bus.

** Processor states.

 * C0 is the operating state.
 * C1 (often known as Halt) is a state where the processor is not executing
   instructions, but can return to an executing state essentially
   instantaneously. All ACPI-conformant processors must support this power state.
 * C2 (often known as Stop-Clock) is a state where the processor maintains all
   software-visible state, but may take longer to wake up. This processor
   state is optional.
 * C3 (often known as Sleep) is a state where the processor does not need to
   keep its cache coherent, but maintains other state. Some processors have
   variations on the C3 state (Deep Sleep, Deeper Sleep, etc.) that differ in
   how long it takes to wake the processor. This processor state is optional.

** Performance states.

 * P0 max power and frequency.
 * P1 less than P0, voltage/frequency scaled.
 * Pn less than P(n-1), voltage/frequency scaled.

* Control power schema under Windows.

Use powercfg utility. To se current state:

  cmd> powercfg /QUERY

To see all available states:

  cmd> powercfg /LIST

To restore power configurtion:

  cmd> powercfg /RestoreDefaultPolicies

* Intel.

** Intel Speedstep® Technology.

  http://www.intel.com/support/processors/sb/CS-028855.htm
                Frequently asked questions for Intel Speedstep® Technology
  http://www.intel.com/p/en_US/support/highlights/processors/frequencyid
                Intel® Processor Frequency ID Utility
  http://software.intel.com/en-us/articles/enhanced-intel-speedstepr-technology-and-demand-based-switching-on-linux
                Enhanced Intel SpeedStep® Technology and Demand-Based Switching on Linux