Dynamic Frequency Scaling and Dynamic Voltage Scaling
‘Frequency’ in this context refers to the clock frequency or the frequency of operation of a CPU. So the term Dynamic Frequency Scaling refers to the change of the clock frequency of the CPU during runtime.
Now the above definition would instantly give rise to the question, Why do we need to do that?
The answer to this question lies at the trade off between Performance and Power Consumption. We know that the performance of a processor depends on 2 metrics, these are:
- CPU Response Time
- Throughput of the CPU
Performance metric is used for the determination of the performance of a Computer depends upon the application of the computer system.
For example in case of Personal Computing Systems the Response Time is very important and often is the sole basis for the determination of the performance of the computer.
Whereas in case of Servers the throughput i.e. is the amount of work done in a given amount of time is much more important.
But, for the purpose of this article when we say ‘Performance’ we will be concerning ourselves only with the Response Time.
On one hand we can increase the clock frequency of the CPU to reduce its response time and improve its performance but after a certain limit we need to also increase the voltage input to the CPU to maintain its stability at the high clock frequencies which in turn increases the Power Consumption and Heat Dissipation of the CPU, thereby shortening its lifespan.
On the other hand we can reduce the clock frequency of the CPU below the standard values allowing us to undervolt the CPU and hence reduce the amount of Power Consumption by the CPU, but this has a negative impact on the CPU performance.
Performance Clock Frequency Power Consumption Clock Frequency
Now, Dynamic Frequency Scaling is a technique to balance the performance and Power Consumption. It refers to a continual variation of the clock frequency to optimize performance and Power Consumption of a CPU.
Now the manner in which the CPU frequency is scaled is determined by the frequency scaling algorithm used and the present CPU load. These frequency scaling algorithms are part of the Kernel Code.
Some of the most common Frequency Scaling Algorithms used in the Linux Kernel are:
This Frequency Scaling Algorithm statically fixes the frequency of the CPU to its highest possible value. This increases the Power Consumption by the CPU
This Frequency Scaling Algorithm Statically fixes the frequency of the CPU to its lowest possible value. This takes it toll on the performance of the system.
This Frequency Scaling Algorithm adjusts the frequency of the CPU to a certain minimum possible value so as to keep the CPU load below a certain percentage. This algorithm tries to optimize the power consumption while keeping the power consumption.