1fc7db767SRafael J. Wysocki.. SPDX-License-Identifier: GPL-2.0
2fc1860d6SRafael J. Wysocki.. include:: <isonum.txt>
3fc7db767SRafael J. Wysocki
40c0b6b7bSRafael J. Wysocki===========================
50c0b6b7bSRafael J. WysockiPower Management Strategies
60c0b6b7bSRafael J. Wysocki===========================
70c0b6b7bSRafael J. Wysocki
8fc1860d6SRafael J. Wysocki:Copyright: |copy| 2017 Intel Corporation
90c0b6b7bSRafael J. Wysocki
10fc1860d6SRafael J. Wysocki:Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11fc1860d6SRafael J. Wysocki
120c0b6b7bSRafael J. Wysocki
130c0b6b7bSRafael J. WysockiThe Linux kernel supports two major high-level power management strategies.
140c0b6b7bSRafael J. Wysocki
150c0b6b7bSRafael J. WysockiOne of them is based on using global low-power states of the whole system in
160c0b6b7bSRafael J. Wysockiwhich user space code cannot be executed and the overall system activity is
170c0b6b7bSRafael J. Wysockisignificantly reduced, referred to as :doc:`sleep states <sleep-states>`.  The
180c0b6b7bSRafael J. Wysockikernel puts the system into one of these states when requested by user space
190c0b6b7bSRafael J. Wysockiand the system stays in it until a special signal is received from one of
200c0b6b7bSRafael J. Wysockidesignated devices, triggering a transition to the ``working state`` in which
210c0b6b7bSRafael J. Wysockiuser space code can run.  Because sleep states are global and the whole system
220c0b6b7bSRafael J. Wysockiis affected by the state changes, this strategy is referred to as the
230c0b6b7bSRafael J. Wysocki:doc:`system-wide power management <system-wide>`.
240c0b6b7bSRafael J. Wysocki
250c0b6b7bSRafael J. WysockiThe other strategy, referred to as the :doc:`working-state power management
260c0b6b7bSRafael J. Wysocki<working-state>`, is based on adjusting the power states of individual hardware
270c0b6b7bSRafael J. Wysockicomponents of the system, as needed, in the working state.  In consequence, if
280c0b6b7bSRafael J. Wysockithis strategy is in use, the working state of the system usually does not
290c0b6b7bSRafael J. Wysockicorrespond to any particular physical configuration of it, but can be treated as
300c0b6b7bSRafael J. Wysockia metastate covering a range of different power states of the system in which
310c0b6b7bSRafael J. Wysockithe individual components of it can be either ``active`` (in use) or
320c0b6b7bSRafael J. Wysocki``inactive`` (idle).  If they are active, they have to be in power states
330c0b6b7bSRafael J. Wysockiallowing them to process data and to be accessed by software.  In turn, if they
340c0b6b7bSRafael J. Wysockiare inactive, ideally, they should be in low-power states in which they may not
350c0b6b7bSRafael J. Wysockibe accessible.
360c0b6b7bSRafael J. Wysocki
370c0b6b7bSRafael J. WysockiIf all of the system components are active, the system as a whole is regarded as
380c0b6b7bSRafael J. Wysocki"runtime active" and that situation typically corresponds to the maximum power
390c0b6b7bSRafael J. Wysockidraw (or maximum energy usage) of it.  If all of them are inactive, the system
400c0b6b7bSRafael J. Wysockias a whole is regarded as "runtime idle" which may be very close to a sleep
410c0b6b7bSRafael J. Wysockistate from the physical system configuration and power draw perspective, but
420c0b6b7bSRafael J. Wysockithen it takes much less time and effort to start executing user space code than
430c0b6b7bSRafael J. Wysockifor the same system in a sleep state.  However, transitions from sleep states
440c0b6b7bSRafael J. Wysockiback to the working state can only be started by a limited set of devices, so
450c0b6b7bSRafael J. Wysockitypically the system can spend much more time in a sleep state than it can be
460c0b6b7bSRafael J. Wysockiruntime idle in one go.  For this reason, systems usually use less energy in
470c0b6b7bSRafael J. Wysockisleep states than when they are runtime idle most of the time.
480c0b6b7bSRafael J. Wysocki
490c0b6b7bSRafael J. WysockiMoreover, the two power management strategies address different usage scenarios.
500c0b6b7bSRafael J. WysockiNamely, if the user indicates that the system will not be in use going forward,
510c0b6b7bSRafael J. Wysockifor example by closing its lid (if the system is a laptop), it probably should
520c0b6b7bSRafael J. Wysockigo into a sleep state at that point.  On the other hand, if the user simply goes
530c0b6b7bSRafael J. Wysockiaway from the laptop keyboard, it probably should stay in the working state and
540c0b6b7bSRafael J. Wysockiuse the working-state power management in case it becomes idle, because the user
550c0b6b7bSRafael J. Wysockimay come back to it at any time and then may want the system to be immediately
560c0b6b7bSRafael J. Wysockiaccessible.
57