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