Lines Matching +full:one +full:- +full:timer +full:- +full:only

1 .. SPDX-License-Identifier: GPL-2.0
27 CPU idle time management is an energy-efficiency feature concerned about using
31 ------------
37 software as individual single-core processors. In other words, a CPU is an
38 entity which appears to be fetching instructions that belong to one sequence
42 First, if the whole processor can only follow one sequence of instructions (one
46 Second, if the processor is multi-core, each core in it is able to follow at
47 least one program at a time. The cores need not be entirely independent of each
49 work physically in parallel with each other, so if each of them executes only
50 one program, those programs run mostly independently of each other at the same
56 except for one have been put into idle states at the "core level" and the
61 Finally, each core in a multi-core processor may be able to follow more than one
66 multiple individual single-core "processors", referred to as *hardware threads*
67 (or hyper-threads specifically on Intel hardware), that each can follow one
70 by one of them, the hardware thread (or CPU) that asked for it is stopped, but
78 ---------
94 assigns it to one of the available CPUs to run and if there are no more runnable
96 code (from the instruction following the last one executed so far, possibly by
97 another CPU). [If there are multiple runnable tasks assigned to one CPU
104 code may cause the processor to be put into one of its idle states, if they are
112 .. _idle-loop:
127 the platform or the processor architecture and organized in a one-dimensional
134 taken into account by the governor, the *target residency* and the (worst-case)
137 substantial), in order to save more energy than it would save by entering one of
148 First of all, the governor knows the time until the closest timer event. That
152 and exit it. However, the CPU may be woken up by a non-timer event at any time
153 (in particular, before the closest timer triggers) and it generally is not known
154 when that may happen. The governor can only see how much time the CPU actually
157 time until the closest timer to estimate the idle duration in future. How the
159 and that is the primary reason for having more than one governor in the
162 There are four ``CPUIdle`` governors available, ``menu``, `TEO <teo-gov_>`_,
165 tick can be `stopped by the idle loop <idle-cpus-and-tick_>`_. Available
173 platform the kernel is running on, but there are platforms with more than one
175 majority of Intel platforms, ``intel_idle`` and ``acpi_idle``, one with
179 decision on which one of them to use has to be made early (on Intel platforms
186 .. _idle-cpus-and-tick:
191 The scheduler tick is a timer that triggers periodically in order to implement
193 multiple runnable tasks assigned to one CPU at the same time, the only way to
200 is there to make the switch happen regardless. That is not the only role of the
214 "idle" one. In other words, from the CPU scheduler perspective, the only user
223 (non-tick) timer due to trigger within the tick range, stopping the tick clearly
224 would be a waste of time, even though the timer hardware may not need to be
225 reprogrammed in that case. Second, if the governor is expecting a non-timer
232 waste of time and in this case the timer hardware would need to be reprogrammed,
243 stopped already (in one of the previous iterations of the loop), it is better
247 loop altogether. That can be done through the build-time configuration of it
255 generally regarded as more energy-efficient than the systems running kernels in
261 .. _menu-gov:
287 the time until the closest timer event with the assumption that the scheduler
296 one.
312 Now, the governor is ready to walk the list of idle states and choose one of
315 limit coming from the power management quality of service, or `PM QoS <cpu-pm-qos_>`_,
321 if it has not decided to `stop the scheduler tick <idle-cpus-and-tick_>`_. That
325 the real time until the closest timer event and if it really is greater than
330 .. _teo-gov:
332 The Timer Events Oriented (TEO) Governor
335 The timer events oriented (TEO) governor is an alternative ``CPUIdle`` governor
336 for tickless systems. It follows the same basic strategy as the ``menu`` `one
337 <menu-gov_>`_: it always tries to find the deepest idle state suitable for the
340 .. kernel-doc:: drivers/cpuidle/governors/teo.c
341 :doc: teo-description
343 .. _idle-states-representation:
349 supported by the processor have to be represented as a one-dimensional array of
352 is a hierarchy of units in the processor, one |struct cpuidle_state| object can
355 of it <idle-loop_>`_, must reflect the properties of the idle state at the
361 (say "X") at the "core" level by one core will trigger the module to try to
394 :c:type:`struct cpuidle_state_usage <cpuidle_state_usage>` one containing usage
402 objects defined for the given CPU minus one. Each of these directories
403 corresponds to one idle state object and the larger the number in its name, the
457 The :file:`disable` attribute is the only writeable one. If it contains 1, the
461 However, disabling an idle state for one CPU does not prevent it from being
465 selecting any idle states deeper than the disabled one too.]
485 this idle state and entered a shallower one instead of it (or even it did not
486 enter any idle state at all). The kernel can only measure the time span between
492 particular case. For these reasons, the only reliable way to find out how
502 .. _cpu-pm-qos:
509 energy-efficiency features of the kernel to prevent performance from dropping
518 signed 32-bit integer) to it. In turn, the resume latency constraint for a CPU
520 32-bit integer) to the :file:`power/pm_qos_resume_latency_us` file under
542 new limit value will only change the real limit if the effective "list" value is
549 request only.
558 In turn, for each CPU there is one resume latency PM QoS request associated with
564 to avoid confusion. [Arguably, the only legitimate use of this mechanism in
567 still only a request, however. It is an entry in a priority list used to
583 `disabled for individual CPUs <idle-states-representation_>`_, there are kernel
594 however, so it is rather crude and not very energy-efficient. For this reason,
600 governor will be used instead of the default one. It is possible to force
605 described below are only relevant for the *x86* architecture and references
606 to ``intel_idle`` affect Intel processors only.
621 CPUs from saving almost any energy at all may not be the only effect of it.
623 P-states (see |cpufreq|) that require any number of CPUs in a package to be
624 idle, so it very well may hurt single-thread computations performance as well as
625 energy-efficiency. Thus using it for performance reasons may not be a good idea
633 case, ``acpi_idle`` driver will function only if all the information needed
636 In addition to the architecture-level kernel command line options affecting CPU
642 `Representation of Idle States <idle-states-representation_>`_), causes the