Lines Matching full:to
16 Every time one of the logical CPUs in the system (the entities that appear to
19 there are no tasks to run on it except for the special "idle" task associated
20 with it, there is an opportunity to save energy for the processor that it
21 belongs to. That can be done by making the idle logical CPU stop fetching
26 situation in principle, so it may be necessary to find the most suitable one
27 (from the kernel perspective) and ask the processor to use (or "enter") that
35 units: *governors* responsible for selecting idle states to ask the processor
36 to enter, *drivers* that pass the governors' decisions on to the hardware and
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.
57 For the governor to be available at all, that object needs to be registered
59 a pointer to it passed as the argument. If successful, that causes the core to
60 add the governor to the global list of available governors and, if it is the
63 governor currently in use, or the name of the new governor was passed to the
67 governor to use at run time via ``sysfs``.
70 practical to put them into loadable kernel modules.
80 The role of this callback is to prepare the governor for handling the
82 to by the ``dev`` argument. The struct cpuidle_driver object pointed
83 to by the ``drv`` argument represents the ``CPUIdle`` driver to be used
86 processor holding the given CPU can be asked to enter).
88 It may fail, in which case it is expected to return a negative error
89 code, and that causes the kernel to run the architecture-specific
99 Called to make the governor stop handling the (logical) CPU represented
100 by the struct cpuidle_device object pointed to by the ``dev``
103 It is expected to reverse any changes made by the ``->enable()``
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
119 struct cpuidle_driver object pointed to by the ``drv`` argument (which
120 represents the ``CPUIdle`` driver to be used with the CPU at hand). The
124 The ``stop_tick`` argument is used to indicate whether or not to stop
125 the scheduler tick before asking the processor to enter the selected
126 idle state. When the ``bool`` variable pointed to by it (which is set
127 to ``true`` before invoking this callback) is cleared to ``false``, the
128 processor will be asked to enter the selected idle state without
131 asking the processor to enter the idle state).
135 of the governor to succeed).
142 Called to allow the governor to evaluate the accuracy of the idle state
144 time) and possibly use the result of that to improve the accuracy of
147 In addition, ``CPUIdle`` governors are required to take power management
149 account when selecting idle states. In order to obtain the current effective
151 expected to pass the number of the CPU to
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
174 :c:member:`target_residency` value is expected to reflect the "depth" of the
180 governors for computations related to idle state selection:
183 Minimum time to spend in this idle state including the time needed to
184 enter it (which may be substantial) to save more energy than could
189 Maximum time it will take a CPU asking the processor to enter this idle
190 state to start executing the first instruction after a wakeup from it,
196 does not represent a real idle state, but an interface to a software
197 "loop" that can be used in order to avoid asking the processor to enter
202 be ``NULL``, points to the routine to execute in order to ask the processor to
210 The first two arguments of it point to the struct cpuidle_device object
214 :c:member:`states` array representing the idle state to ask the processor to
218 only for implementing the suspend-to-idle system-wide power management feature.
220 interrupts at any point (even temporarily) or attempt to change the states of
224 entries in it has to be stored in the :c:member:`state_count` field of the
229 to be the index of an idle state that is not "coupled" (that is, one that can be
232 In addition to that, if the given ``CPUIdle`` driver is only going to handle a
234 struct cpuidle_driver object must point to the set (mask) of CPUs that will be
240 to :c:func:`cpuidle_register_driver()`. Otherwise, :c:func:`cpuidle_register()`
243 However, it also is necessary to register struct cpuidle_device objects for
244 all of the logical CPUs to be handled by the given ``CPUIdle`` driver with the
248 :c:func:`cpuidle_register_driver()` to register themselves must also take care
250 recommended to use :c:func:`cpuidle_register()` for ``CPUIdle`` driver
254 ``sysfs`` interface to be created and the governor's ``->enable()`` callback to
260 them to be released. Due to dependencies between them, all of the
264 :c:func:`cpuidle_unregister_driver()` to unregister the driver. Alternatively,
265 :c:func:`cpuidle_unregister()` can be called to unregister a ``CPUIdle`` driver
269 ``CPUIdle`` drivers can respond to runtime system configuration changes that
270 lead to modifications of the list of available processor idle states (which can
271 happen, for example, when the system's power source is switched from AC to
273 a ``CPUIdle`` driver is expected to call :c:func:`cpuidle_pause_and_lock()` to
279 :c:func:`cpuidle_resume_and_unlock()` to allow ``CPUIdle`` to be used again.