Lines Matching full:to

19 different clock frequency and voltage configurations, often referred to as
28 In some situations it is desirable or even necessary to run the program as fast
29 as possible and then there is no reason to use any P-states different from the
31 available). In some other cases, however, it may not be necessary to execute
34 It also may not be physically possible to maintain maximum CPU capacity for too
35 long for thermal or power supply capacity reasons or similar. To cover those
36 cases, there are hardware interfaces allowing CPUs to be switched between
37 different frequency/voltage configurations or (in the ACPI terminology) to be
40 Typically, they are used along with algorithms to estimate the required CPU
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
59 Scaling governors implement algorithms to estimate the required CPU capacity.
63 Scaling drivers talk to the hardware. They provide scaling governors with
65 access platform-specific hardware interfaces to change CPU P-states as requested
72 to use the same performance scaling algorithm implemented in exactly the same
78 feedback registers, as that information is typically specific to the hardware
81 to bypass the governor layer and implement their own performance scaling
89 CPUs. That is, for example, the same register (or set of registers) is used to
90 control the P-state of multiple CPUs at the same time and writing to it affects
98 The ``CPUFreq`` core maintains a pointer to a struct cpufreq_policy object for
101 corresponding to them point to the same struct cpufreq_policy object.
110 First of all, a scaling driver has to be registered for ``CPUFreq`` to work.
111 It is only possible to register one scaling driver at a time, so the scaling
112 driver is expected to be able to handle all CPUs in the system.
115 CPUs are registered earlier, the driver core invokes the ``CPUFreq`` core to
118 the scaling driver, the ``CPUFreq`` core will be invoked to take note of them
121 In any case, the ``CPUFreq`` core is invoked to take note of any logical CPU it
122 has not seen so far as soon as it is ready to handle that CPU. [Note that the
126 otherwise and the word "processor" is used to refer to the physical part
132 a new policy directory in ``sysfs``, and the policy pointer corresponding to
133 the given CPU is set to the new policy object's address in memory.
136 pointer of the new CPU passed to it as the argument. That callback is expected
137 to initialize the performance scaling hardware interface for the given CPU (or,
139 to, represented by its policy object) and, if the policy object it has been
140 called for is new, to set parameters of the policy, like the minimum and maximum
143 that belong to the same policy (including both online and offline CPUs). That
144 mask is then used by the core to populate the policy pointers for all of the
147 The next major initialization step for a new policy object is to attach a
148 scaling governor to it (to begin with, that is the default scaling governor
150 later via ``sysfs``). First, a pointer to the new policy object is passed to
151 the governor's ``->init()`` callback which is expected to initialize all of the
152 data structures necessary to handle the given policy and, possibly, to add
153 a governor ``sysfs`` interface to it. Next, the governor is started by
156 That callback is expected to register per-CPU utilization update callbacks for
157 all of the online CPUs belonging to the given policy with the CPU scheduler.
161 scheduler's perspective). They are expected to carry out computations needed
162 to determine the P-state to use for the given policy going forward and to
163 invoke the scaling driver to make changes to the hardware in accordance with
169 previously, meaning that all of the CPUs belonging to them were offline. The
171 to use the scaling governor previously used with the policy that became
176 need to re-initialize the policy object at all. In that case, it only is
177 necessary to restart the scaling governor so that it can take the new online CPU
183 Consequently, if |intel_pstate| is used, scaling governors are not attached to
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
194 when the last CPU belonging to the given policy in unregistered.
206 Each ``policyX`` directory is pointed to by ``cpufreq`` symbolic links
209 associated with (or belonging to) the given policy. The ``policyX`` directories
211 attributes (files) to control ``CPUFreq`` behavior for the corresponding policy
216 and what scaling governor is attached to the given policy. Some scaling drivers
217 also add driver-specific attributes to the policy directories in ``sysfs`` to
224 List of online CPUs belonging to this policy (i.e. sharing the hardware
229 If the platform firmware (BIOS) tells the OS to apply an upper limit to
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.
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
274 The time it takes to switch the CPUs belonging to this policy from one
275 P-state to another, in nanoseconds.
278 List of all (online and offline) CPUs belonging to this policy.
281 List of available frequencies of the CPUs belonging to this policy
286 be attached to this policy or (if the |intel_pstate| scaling driver is
288 applied to this policy.
290 [Note that some governors are modular and it may be necessary to load a
291 kernel module for the governor held by it to become available and be
295 Current frequency of all of the CPUs belonging to this policy (in kHz).
300 the CPU is actually running at (due to hardware design and other
303 Some architectures (e.g. ``x86``) may attempt to provide information
313 The scaling governor currently attached to this policy or (if the
315 provided by the driver that is currently applied to this policy.
317 This attribute is read-write and writing to it will cause a new scaling
318 governor to be attached to this policy or a new scaling algorithm
319 provided by the scaling driver to be applied to it (in the
320 |intel_pstate| case), as indicated by the string written to this
325 Maximum frequency the CPUs belonging to this policy are allowed to be
329 integer to it will cause a new limit to be set (it must not be lower
333 Minimum frequency the CPUs belonging to this policy are allowed to be
337 non-negative integer to it will cause a new limit to be set (it must not
342 is attached to the given policy.
345 be written to in order to set a new frequency for the policy.
355 Scaling governors are attached to policy objects and different policy objects
357 may lead to suboptimal results in some cases).
362 Some governors expose ``sysfs`` attributes to control or fine-tune the scaling
363 algorithms implemented by them. Those attributes, referred to as governor
365 scaling driver in use. If the driver requires governor tunables to be
375 When attached to a policy object, this governor causes the highest frequency,
376 within the ``scaling_max_freq`` policy limit, to be requested for that policy.
378 The request is made once at that time the governor for the policy is set to
385 When attached to a policy object, this governor causes the lowest frequency,
386 within the ``scaling_min_freq`` policy limit, to be requested for that policy.
388 The request is made once at that time the governor for the policy is set to
396 to set the CPU frequency for the policy it is attached to by writing to the
397 ``scaling_setspeed`` attribute of that policy. Though the intention may be to
408 It runs entirely in scheduler context, although in some cases it may need to
415 RT or deadline scheduling classes, the governor will increase the frequency to
421 CPU frequency to apply is computed in accordance with the formula
430 This governor also employs a mechanism allowing it to temporarily bump up the
433 is passed by the scheduler to the governor callback which causes the frequency
434 to go up to the allowed maximum immediately and then draw back to the value
440 Minimum time (in microseconds) that has to pass between two consecutive
444 The purpose of this tunable is to reduce the scheduler context overhead
459 In order to estimate the current CPU load, it measures the time elapsed between
462 time to the total CPU time is taken as an estimate of the load.
464 If this governor is attached to a policy shared by multiple CPUs, the load is
468 The worker routine of this governor has to run in process context, so it is
471 governor is minimum, but it causes additional CPU context switches to happen
477 It generally selects CPU frequencies proportional to the estimated load, so that
478 the value of the ``cpuinfo_max_freq`` policy attribute corresponds to the load of
480 corresponds to the load of 0, unless when the load exceeds a (configurable)
482 it is allowed to use (the ``scaling_max_freq`` policy limit).
490 Typically, it is set to values of the order of 2000 (2 ms). Its
491 default value is to add a 50% breathing room
492 to ``cpuinfo_transition_latency`` on each policy this governor is
493 attached to. The minimum is typically the length of two scheduler
497 represented by it to be 1.5 times as high as the transition latency
504 will set the frequency to the maximum value allowed for the policy.
505 Otherwise, the selected frequency will be proportional to the estimated
509 If set to 1 (default 0), it will cause the CPU load estimation code to
514 taken into account when deciding what frequency to run the CPUs at.
515 Then, to make that happen it is sufficient to increase the "nice" level
516 of those tasks above 0 and set this attribute to 1.
519 Temporary multiplier, between 1 (default) and 100 inclusive, to apply to
523 setting the frequency to the allowed maximum) to be delayed, so the
531 Reduction factor to apply to the original frequency target of the
539 the effective frequency to apply is given by
550 On Family 16h (and later) AMD processors there is a mechanism to get a
552 hardware. That value can be used to estimate how the performance of the
553 workload running on a CPU will change in response to frequency changes.
556 IO-bound) is not expected to increase at all as a result of increasing
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
577 battery-powered). To achieve that, it changes the frequency in relatively
585 allowed to set (the ``scaling_max_freq`` policy limit), between 0 and
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
590 and setting it to 100 effectively causes the governor to periodically
595 Threshold value (in percent, 20 by default) used to determine the
607 It effectively causes the frequency to go down ``sampling_down_factor``
617 Some processors support a mechanism to raise the operating frequency of some
622 Different names are used by different vendors to refer to this functionality.
623 For Intel processors it is referred to as "Turbo Boost", AMD calls it
626 term "frequency boost" is used here for brevity to refer to all of those
630 If it is hardware-based (e.g. on x86), the decision to trigger the boosting is
631 made by the hardware (although in general it requires the hardware to be put
634 whether or not to trigger boosting and when to do that.
646 means that either the hardware can be put into states in which it is able to
647 trigger boosting (in the hardware-based case), or the software is allowed to
650 permission to use the frequency boost mechanism (which still may never be used
656 The only values that can be written to this file are 0 and 1.
661 The frequency boost mechanism is generally intended to help to achieve optimum
664 it may lead to problems in certain situations.
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
668 be restarted for the setting to be adjusted as desired, which may not be
674 That may not be desirable on systems that switch to power sources of
675 limited capacity, such as batteries, so the ability to disable the boost
680 performance or energy consumption (or both) and the ability to disable
683 3. To examine the impact of the frequency boost mechanism itself, it is useful
684 to be able to run tests with and without boosting, preferably without
689 single-thread performance may vary because of it which may lead to
691 frequency boost mechanism before running benchmarks sensitive to that
697 The AMD powernow-k8 scaling driver supports a ``sysfs`` knob very similar to
705 for one policy causes the same value of it to be set for all of the other