Lines Matching full:to

21 Every time one of the logical CPUs in the system (the entities that appear to
24 there are no tasks to run on it except for the special "idle" task associated
25 with it, there is an opportunity to save energy for the processor that it
26 belongs to. That can be done by making the idle logical CPU stop fetching
31 situation in principle, so it may be necessary to find the most suitable one
32 (from the kernel perspective) and ask the processor to use (or "enter") that
40 units: *governors* responsible for selecting idle states to ask the processor
41 to enter, *drivers* that pass the governors' decisions on to the hardware and
49 one of the logical CPUs in the system turns out to be idle. Its role is to
50 select an idle state to ask the processor to enter in order to save some energy.
62 For the governor to be available at all, that object needs to be registered
64 a pointer to it passed as the argument. If successful, that causes the core to
65 add the governor to the global list of available governors and, if it is the
68 governor currently in use, or the name of the new governor was passed to the
71 governor in use at a time). Also, if ``cpuidle_sysfs_switch`` is passed to the
72 kernel in the command line, user space can choose the ``CPUIdle`` governor to
76 practical to put them into loadable kernel modules.
86 The role of this callback is to prepare the governor for handling the
88 to by the ``dev`` argument. The |struct cpuidle_driver| object pointed
89 to by the ``drv`` argument represents the ``CPUIdle`` driver to be used
92 processor holding the given CPU can be asked to enter).
94 It may fail, in which case it is expected to return a negative error
95 code, and that causes the kernel to run the architecture-specific
105 Called to make the governor stop handling the (logical) CPU represented
106 by the |struct cpuidle_device| object pointed to by the ``dev``
109 It is expected to reverse any changes made by the ``->enable()``
119 Called to select an idle state for the processor holding the (logical)
120 CPU represented by the |struct cpuidle_device| object pointed to by the
123 The list of idle states to take into consideration is represented by the
125 |struct cpuidle_driver| object pointed to by the ``drv`` argument (which
126 represents the ``CPUIdle`` driver to be used with the CPU at hand). The
130 The ``stop_tick`` argument is used to indicate whether or not to stop
131 the scheduler tick before asking the processor to enter the selected
132 idle state. When the ``bool`` variable pointed to by it (which is set
133 to ``true`` before invoking this callback) is cleared to ``false``, the
134 processor will be asked to enter the selected idle state without
137 asking the processor to enter the idle state).
141 of the governor to succeed).
148 Called to allow the governor to evaluate the accuracy of the idle state
150 time) and possibly use the result of that to improve the accuracy of
153 In addition, ``CPUIdle`` governors are required to take power management
155 account when selecting idle states. In order to obtain the current effective
157 expected to pass the number of the CPU to
170 First of all, a ``CPUIdle`` driver has to populate the :c:member:`states` array
173 idle states that the processor hardware can be asked to enter shared by all of
176 The entries in the :c:member:`states` array are expected to be sorted by the
178 the ascending order (that is, index 0 should correspond to the idle state with
180 :c:member:`target_residency` value is expected to reflect the "depth" of the
186 governors for computations related to idle state selection:
189 Minimum time to spend in this idle state including the time needed to
190 enter it (which may be substantial) to save more energy than could
195 Maximum time it will take a CPU asking the processor to enter this idle
196 state to start executing the first instruction after a wakeup from it,
202 does not represent a real idle state, but an interface to a software
203 "loop" that can be used in order to avoid asking the processor to enter
208 be ``NULL``, points to the routine to execute in order to ask the processor to
216 The first two arguments of it point to the |struct cpuidle_device| object
220 :c:member:`states` array representing the idle state to ask the processor to
224 only for implementing the suspend-to-idle system-wide power management feature.
226 interrupts at any point (even temporarily) or attempt to change the states of
230 entries in it has to be stored in the :c:member:`state_count` field of the
235 to be the index of an idle state that is not "coupled" (that is, one that can be
238 In addition to that, if the given ``CPUIdle`` driver is only going to handle a
240 |struct cpuidle_driver| object must point to the set (mask) of CPUs that will be
246 to :c:func:`cpuidle_register_driver()`. Otherwise, :c:func:`cpuidle_register()`
249 However, it also is necessary to register |struct cpuidle_device| objects for
250 all of the logical CPUs to be handled by the given ``CPUIdle`` driver with the
254 :c:func:`cpuidle_register_driver()` to register themselves must also take care
256 recommended to use :c:func:`cpuidle_register()` for ``CPUIdle`` driver
260 ``sysfs`` interface to be created and the governor's ``->enable()`` callback to
266 them to be released. Due to dependencies between them, all of the
270 :c:func:`cpuidle_unregister_driver()` to unregister the driver. Alternatively,
271 :c:func:`cpuidle_unregister()` can be called to unregister a ``CPUIdle`` driver
275 ``CPUIdle`` drivers can respond to runtime system configuration changes that
276 lead to modifications of the list of available processor idle states (which can
277 happen, for example, when the system's power source is switched from AC to
279 a ``CPUIdle`` driver is expected to call :c:func:`cpuidle_pause_and_lock()` to
285 :c:func:`cpuidle_resume_and_unlock()` to allow ``CPUIdle`` to be used again.