Lines Matching +full:system +full:- +full:clock +full:- +full:frequency

1 .. SPDX-License-Identifier: GPL-2.0
19 different clock frequency and voltage configurations, often referred to as
20 Operating Performance Points or P-states (in ACPI terminology). As a rule,
21 the higher the clock frequency and the higher the voltage, the more instructions
22 can be retired by the CPU over a unit of time, but also the higher the clock
23 frequency and the higher the voltage, the more energy is consumed over a unit of
24 time (or the more power is drawn) by the CPU in the given P-state. Therefore
29 as possible and then there is no reason to use any P-states different from the
30 highest one (i.e. the highest-performance frequency/voltage configuration
37 different frequency/voltage configurations or (in the ACPI terminology) to be
38 put into different P-states.
41 capacity, so as to decide which P-states to put the CPUs into. Of course, since
42 the utilization of the system generally changes over time, that has to be done
44 to as CPU performance scaling or CPU frequency scaling (because it involves
45 adjusting the CPU clock frequency).
52 (CPU Frequency scaling) subsystem that consists of three layers of code: the
64 information on the available P-states (or P-state ranges in some cases) and
65 access platform-specific hardware interfaces to change CPU P-states as requested
70 performance scaling algorithms for P-state selection can be represented in a
71 platform-independent form in the majority of cases, so it should be possible
80 platform-independent way. For this reason, ``CPUFreq`` allows scaling drivers
88 In some cases the hardware interface for P-state control is shared by multiple
90 control the P-state of multiple CPUs at the same time and writing to it affects
93 Sets of CPUs sharing hardware P-state control interfaces are represented by
99 every CPU in the system, including CPUs that are currently offline. If multiple
100 CPUs share the same hardware P-state control interface, all of the pointers
112 driver is expected to be able to handle all CPUs in the system.
123 logical CPU may be a physical single-core processor, or a single core in a
135 Next, the scaling driver's ``->init()`` callback is invoked with the policy
142 the set of supported P-states is not a continuous range), and the mask of CPUs
151 the governor's ``->init()`` callback which is expected to initialize all of the
154 invoking its ``->start()`` callback.
156 That callback is expected to register per-CPU utilization update callbacks for
162 to determine the P-state to use for the given policy going forward and to
164 the P-state selection. The scaling driver may be invoked directly from
172 "inactive" (and is re-initialized now) instead of the default governor.
176 need to re-initialize the policy object at all. In that case, it only is
178 into account. That is achieved by invoking the governor's ``->stop`` and
179 ``->start()`` callbacks, in this order, for the entire policy.
182 governor layer of ``CPUFreq`` and provides its own P-state selection algorithms.
184 new policy objects. Instead, the driver's ``->setpolicy()`` callback is invoked
185 to register per-CPU utilization update callbacks for each policy. These
187 governors, but in the |intel_pstate| case they both determine the P-state to
202 :file:`/sys/devices/system/cpu/`.
207 under :file:`/sys/devices/system/cpu/cpuY/` (where ``Y`` represents an integer
210 in :file:`/sys/devices/system/cpu/cpufreq` each contain policy-specific
217 also add driver-specific attributes to the policy directories in ``sysfs`` to
218 control policy-specific aspects of driver behavior.
220 The generic attributes under :file:`/sys/devices/system/cpu/cpufreq/policyX/`
235 BIOS/HW-based mechanisms.
244 Current frequency of the CPUs belonging to this policy as obtained from
247 This is expected to be the frequency the hardware actually runs at.
248 If that frequency cannot be determined, this attribute should not
252 An average frequency (in KHz) of all CPUs belonging to a given policy,
256 This is expected to be based on the frequency the hardware actually runs
261 Note that failed attempt to retrieve current frequency for a given
266 Maximum possible operating frequency the CPUs belonging to this policy
270 Minimum possible operating frequency the CPUs belonging to this policy
275 P-state to another, in nanoseconds.
295 Current frequency of all of the CPUs belonging to this policy (in kHz).
297 In the majority of cases, this is the frequency of the last P-state
299 interface provided by it, which may or may not reflect the frequency
304 more precisely reflecting the current CPU frequency through this
305 attribute, but that still may not be the exact current CPU frequency as
317 This attribute is read-write and writing to it will cause a new scaling
325 Maximum frequency the CPUs belonging to this policy are allowed to be
328 This attribute is read-write and writing a string representing an
333 Minimum frequency the CPUs belonging to this policy are allowed to be
336 This attribute is read-write and writing a string representing a
337 non-negative integer to it will cause a new limit to be set (it must not
344 It returns the last frequency requested by the governor (in kHz) or can
345 be written to in order to set a new frequency for the policy.
362 Some governors expose ``sysfs`` attributes to control or fine-tune the scaling
364 tunables, can be either global (system-wide) or per-policy, depending on the
366 per-policy, they are located in a subdirectory of each policy directory.
368 :file:`/sys/devices/system/cpu/cpufreq/`. In either case the name of the
373 ---------------
375 When attached to a policy object, this governor causes the highest frequency,
383 -------------
385 When attached to a policy object, this governor causes the lowest frequency,
393 -------------
396 to set the CPU frequency for the policy it is attached to by writing to the
398 set an exact frequency for the policy, the actual frequency may vary depending
402 -------------
409 invoke the scaling driver asynchronously when it decides that the CPU frequency
411 is capable of changing the CPU frequency from scheduler context).
415 RT or deadline scheduling classes, the governor will increase the frequency to
418 Per-Entity Load Tracking (PELT) metric for the root control group of the
419 given CPU as the CPU utilization estimate (see the *Per-entity load tracking*
421 CPU frequency to apply is computed in accordance with the formula
426 ``util``, and ``f_0`` is either the maximum possible CPU frequency for the given
427 policy (if the PELT number is frequency-invariant), or the current CPU frequency
431 CPU frequency for tasks that have been waiting on I/O most recently, called
432 "IO-wait boosting". That happens when the :c:macro:`SCHED_CPUFREQ_IOWAIT` flag
433 is passed by the scheduler to the governor callback which causes the frequency
455 ------------
457 This governor uses CPU load as a CPU frequency selection metric.
461 time in which the given CPU was not idle. The ratio of the non-idle (active)
469 invoked asynchronously (via a workqueue) and CPU P-states are updated from
472 relatively often and the CPU P-state updates triggered by it can be relatively
481 speedup threshold, in which case it will go straight for the highest frequency
496 If this tunable is per-policy, the following shell command sets the time
504 will set the frequency to the maximum value allowed for the policy.
505 Otherwise, the selected frequency will be proportional to the estimated
513 This may be useful if there are tasks in the system that should not be
514 taken into account when deciding what frequency to run the CPUs at.
523 setting the frequency to the allowed maximum) to be delayed, so the
524 frequency stays at the maximum level for a longer time.
526 Frequency fluctuations in some bursty workloads may be avoided this way
531 Reduction factor to apply to the original frequency target of the
534 for the AMD frequency sensitivity powersave bias driver
538 If the AMD frequency sensitivity powersave bias driver is not loaded,
539 the effective frequency to apply is given by
541 f * (1 - ``powersave_bias`` / 1000)
543 where f is the governor's original frequency target. The default value
546 If the AMD frequency sensitivity powersave bias driver is loaded, the
553 workload running on a CPU will change in response to frequency changes.
555 The performance of a workload with the sensitivity of 0 (memory-bound or
556 IO-bound) is not expected to increase at all as a result of increasing
557 the CPU frequency, whereas workloads with the sensitivity of 100%
558 (CPU-bound) are expected to perform much better if the CPU frequency is
563 will cause the governor to select a frequency lower than its original
564 target, so as to avoid over-provisioning workloads that will not benefit
568 ----------------
570 This governor uses CPU load as a CPU frequency selection metric.
573 above, but the CPU frequency selection algorithm implemented by it is different.
575 Namely, it avoids changing the frequency significantly over short time intervals
577 battery-powered). To achieve that, it changes the frequency in relatively
578 small steps, one step at a time, up or down - depending on whether or not a
584 Frequency step in percent of the maximum frequency the governor is
588 This is how much the frequency is allowed to change in one go. Setting
589 it to 0 will cause the default frequency step (5 percent) to be used
591 switch the frequency between the ``scaling_min_freq`` and
596 frequency change direction.
598 If the estimated CPU load is greater than this value, the frequency will
600 ``sampling_down_factor`` mechanism is not in effect), the frequency will
601 go down. Otherwise, the frequency will not be changed.
604 Frequency decrease deferral factor, between 1 (default) and 10
607 It effectively causes the frequency to go down ``sampling_down_factor``
611 Frequency Boost Support
615 ----------
617 Some processors support a mechanism to raise the operating frequency of some
618 cores in a multicore package temporarily (and above the sustainable frequency
624 "Turbo-Core" or (in technical documentation) "Core Performance Boost" and so on.
626 term "frequency boost" is used here for brevity to refer to all of those
629 The frequency boost mechanism may be either hardware-based or software-based.
630 If it is hardware-based (e.g. on x86), the decision to trigger the boosting is
632 into a special state in which it can control the CPU frequency within certain
633 limits). If it is software-based (e.g. on ARM), the scaling driver decides
637 -------------------------------
639 This file is located under :file:`/sys/devices/system/cpu/cpufreq/` and controls
640 the "boost" setting for the whole system. It is not present if the underlying
641 scaling driver does not support the frequency boost mechanism (or supports it,
642 but provides a driver-specific interface for controlling it, like
645 If the value in this file is 1, the frequency boost mechanism is enabled. This
647 trigger boosting (in the hardware-based case), or the software is allowed to
648 trigger boosting (in the software-based case). It does not mean that boosting
649 is actually in use at the moment on any CPUs in the system. It only means a
650 permission to use the frequency boost mechanism (which still may never be used
653 If the value in this file is 0, the frequency boost mechanism is disabled and
659 --------------------------------
661 The frequency boost mechanism is generally intended to help to achieve optimum
666 For this reason, many systems make it possible to disable the frequency boost
667 mechanism in the platform firmware (BIOS) setup, but that requires the system to
673 as a result of increasing its frequency and voltage, even temporarily.
676 mechanism while the system is running may help there (but that depends on
681 boosting while the system is running may be useful then.
683 3. To examine the impact of the frequency boost mechanism itself, it is useful
685 restarting the system in the meantime.
689 single-thread performance may vary because of it which may lead to
691 frequency boost mechanism before running benchmarks sensitive to that
695 -----------------------
697 The AMD powernow-k8 scaling driver supports a ``sysfs`` knob very similar to
702 ``sysfs`` (:file:`/sys/devices/system/cpu/cpufreq/policyX/`) and is called
704 implementation, however, works on the system-wide basis and setting that knob
724 .. [1] Jonathan Corbet, *Per-entity load tracking*,