xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/pm/strategies.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun.. SPDX-License-Identifier: GPL-2.0
2*4882a593Smuzhiyun.. include:: <isonum.txt>
3*4882a593Smuzhiyun
4*4882a593Smuzhiyun===========================
5*4882a593SmuzhiyunPower Management Strategies
6*4882a593Smuzhiyun===========================
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun:Copyright: |copy| 2017 Intel Corporation
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun:Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunThe Linux kernel supports two major high-level power management strategies.
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunOne of them is based on using global low-power states of the whole system in
16*4882a593Smuzhiyunwhich user space code cannot be executed and the overall system activity is
17*4882a593Smuzhiyunsignificantly reduced, referred to as :doc:`sleep states <sleep-states>`.  The
18*4882a593Smuzhiyunkernel puts the system into one of these states when requested by user space
19*4882a593Smuzhiyunand the system stays in it until a special signal is received from one of
20*4882a593Smuzhiyundesignated devices, triggering a transition to the ``working state`` in which
21*4882a593Smuzhiyunuser space code can run.  Because sleep states are global and the whole system
22*4882a593Smuzhiyunis affected by the state changes, this strategy is referred to as the
23*4882a593Smuzhiyun:doc:`system-wide power management <system-wide>`.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunThe other strategy, referred to as the :doc:`working-state power management
26*4882a593Smuzhiyun<working-state>`, is based on adjusting the power states of individual hardware
27*4882a593Smuzhiyuncomponents of the system, as needed, in the working state.  In consequence, if
28*4882a593Smuzhiyunthis strategy is in use, the working state of the system usually does not
29*4882a593Smuzhiyuncorrespond to any particular physical configuration of it, but can be treated as
30*4882a593Smuzhiyuna metastate covering a range of different power states of the system in which
31*4882a593Smuzhiyunthe individual components of it can be either ``active`` (in use) or
32*4882a593Smuzhiyun``inactive`` (idle).  If they are active, they have to be in power states
33*4882a593Smuzhiyunallowing them to process data and to be accessed by software.  In turn, if they
34*4882a593Smuzhiyunare inactive, ideally, they should be in low-power states in which they may not
35*4882a593Smuzhiyunbe accessible.
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunIf all of the system components are active, the system as a whole is regarded as
38*4882a593Smuzhiyun"runtime active" and that situation typically corresponds to the maximum power
39*4882a593Smuzhiyundraw (or maximum energy usage) of it.  If all of them are inactive, the system
40*4882a593Smuzhiyunas a whole is regarded as "runtime idle" which may be very close to a sleep
41*4882a593Smuzhiyunstate from the physical system configuration and power draw perspective, but
42*4882a593Smuzhiyunthen it takes much less time and effort to start executing user space code than
43*4882a593Smuzhiyunfor the same system in a sleep state.  However, transitions from sleep states
44*4882a593Smuzhiyunback to the working state can only be started by a limited set of devices, so
45*4882a593Smuzhiyuntypically the system can spend much more time in a sleep state than it can be
46*4882a593Smuzhiyunruntime idle in one go.  For this reason, systems usually use less energy in
47*4882a593Smuzhiyunsleep states than when they are runtime idle most of the time.
48*4882a593Smuzhiyun
49*4882a593SmuzhiyunMoreover, the two power management strategies address different usage scenarios.
50*4882a593SmuzhiyunNamely, if the user indicates that the system will not be in use going forward,
51*4882a593Smuzhiyunfor example by closing its lid (if the system is a laptop), it probably should
52*4882a593Smuzhiyungo into a sleep state at that point.  On the other hand, if the user simply goes
53*4882a593Smuzhiyunaway from the laptop keyboard, it probably should stay in the working state and
54*4882a593Smuzhiyunuse the working-state power management in case it becomes idle, because the user
55*4882a593Smuzhiyunmay come back to it at any time and then may want the system to be immediately
56*4882a593Smuzhiyunaccessible.
57