Lines Matching +full:cpu +full:- +full:idle +full:- +full:states

1 .. SPDX-License-Identifier: GPL-2.0
5 CPU Idle Time Management
13 CPU Idle Time Management Subsystem
18 cores) is idle after an interrupt or equivalent wakeup event, which means that
19 there are no tasks to run on it except for the special "idle" task associated
21 belongs to. That can be done by making the idle logical CPU stop fetching
23 depended on by it into an idle state in which they will draw less power.
25 However, there may be multiple different idle states that can be used in such a
28 particular idle state. That is the role of the CPU idle time management
35 units: *governors* responsible for selecting idle states to ask the processor
40 CPU Idle Time Governors
43 A CPU idle time (``CPUIdle``) governor is a bundle of policy code invoked when
44 one of the logical CPUs in the system turns out to be idle. Its role is to
45 select an idle state to ask the processor to enter in order to save some energy.
81 (logical) CPU represented by the struct cpuidle_device object pointed
84 with that CPU (among other things, it should contain the list of
85 struct cpuidle_state objects representing idle states that the
86 processor holding the given CPU can be asked to enter).
89 code, and that causes the kernel to run the architecture-specific
90 default code for idle CPUs on the CPU in question instead of ``CPUIdle``
91 until the ``->enable()`` governor callback is invoked for that CPU
99 Called to make the governor stop handling the (logical) CPU represented
103 It is expected to reverse any changes made by the ``->enable()``
104 callback when it was last invoked for the target CPU, free all memory
113 Called to select an idle state for the processor holding the (logical)
114 CPU represented by the struct cpuidle_device object pointed to by the
117 The list of idle states to take into consideration is represented by the
118 :c:member:`states` array of struct cpuidle_state objects held by the
120 represents the ``CPUIdle`` driver to be used with the CPU at hand). The
126 idle state. When the ``bool`` variable pointed to by it (which is set
128 processor will be asked to enter the selected idle state without
129 stopping the scheduler tick on the given CPU (if the tick has been
130 stopped on that CPU already, however, it will not be restarted before
131 asking the processor to enter the idle state).
142 Called to allow the governor to evaluate the accuracy of the idle state
143 selection made by the ``->select()`` callback (when it was invoked last
145 idle state selections in the future.
149 account when selecting idle states. In order to obtain the current effective
150 PM QoS wakeup latency constraint for a given CPU, a ``CPUIdle`` governor is
151 expected to pass the number of the CPU to
152 :c:func:`cpuidle_governor_latency_req()`. Then, the governor's ``->select()``
158 CPU Idle Time Management Drivers
161 CPU idle time management (``CPUIdle``) drivers provide an interface between the
164 First of all, a ``CPUIdle`` driver has to populate the :c:member:`states` array
167 idle states that the processor hardware can be asked to enter shared by all of
170 The entries in the :c:member:`states` array are expected to be sorted by the
172 the ascending order (that is, index 0 should correspond to the idle state with
175 idle state represented by the struct cpuidle_state object holding it, this
176 sorting order should be the same as the ascending sorting order by the idle
180 governors for computations related to idle state selection:
183 Minimum time to spend in this idle state including the time needed to
185 be saved by staying in a shallower idle state for the same amount of
189 Maximum time it will take a CPU asking the processor to enter this idle
194 Flags representing idle state properties. Currently, governors only use
196 does not represent a real idle state, but an interface to a software
198 any idle state at all. [There are other flags used by the ``CPUIdle``
203 enter this particular idle state:
211 representing the logical CPU running this callback and the
214 :c:member:`states` array representing the idle state to ask the processor to
217 The analogous ``->enter_s2idle()`` callback in struct cpuidle_state is used
218 only for implementing the suspend-to-idle system-wide power management feature.
219 The difference between in and ``->enter()`` is that it must not re-enable
220 interrupts at any point (even temporarily) or attempt to change the states of
221 clock event devices, which the ``->enter()`` callback may do sometimes.
223 Once the :c:member:`states` array has been populated, the number of valid
226 entries in the :c:member:`states` array represent "coupled" idle states (that
227 is, idle states that can only be asked for if multiple related logical CPUs are
228 idle), the :c:member:`safe_state_index` field in struct cpuidle_driver needs
229 to be the index of an idle state that is not "coupled" (that is, one that can be
230 asked for if only one logical CPU is idle).
238 are no "coupled" idle state entries in the driver's :c:member:`states` array,
254 ``sysfs`` interface to be created and the governor's ``->enable()`` callback to
255 be invoked for the logical CPU represented by it, so it must take place after
256 registering the driver that will handle the CPU in question.
270 lead to modifications of the list of available processor idle states (which can
276 change. Next, it can update its :c:member:`states` array in accordance with