How to Change CPU Performance on Linux? (Scaling Governor) (Tuning)

| F.A.Q.Support

How to Change CPU Performance on Linux? (Scaling Governor) (Tuning)

  1. How to change CPU performance on Linux?
  2. How to change CPU frequency on Linux?

The Scaling Governor is a function that controls the CPU clock frequency based on the load and energy demand. The scaling governor can be set to various modes, such as:

  • Performance - The CPUfreq "performance" governor sets the CPU to a constant clock frequency, which is the highest within the limits specified by scaling_min_freq and scaling_max_freq.
  • Powersave - The CPUfreq "powersave" governor sets the CPU to a constant minimum clock frequency within the limits specified by scaling_min_freq and scaling_max_freq.
  • Userspace - The CPUfreq "userspace" governor allows a user or any program running in the user space with "root" privileges to set the CPU to a specific frequency by providing a sysfs file named "scaling_setspeed" in the CPU device directory.
  • Ondemand - The CPUfreq "ondemand" governor adjusts the CPU frequency according to the current system load. The load estimation is triggered by the scheduler through the "update_util_data->func" function. Upon triggering, cpufreq analyzes the CPU usage statistics over the last period and adjusts the CPU frequency accordingly. The CPU must be capable of very rapid frequency changes.

Each of the above governors has a different strategy for changing the CPU frequency to optimize performance or save energy. The scaling governor can be changed by the user or the operating system, depending on preferences and hardware compatibility.

To see the current scaling_governor settings per CPU: