AM6 CPU freq and num of cores

From Variscite Wiki
Revision as of 22:03, 22 March 2023 by Nate (talk | contribs)
Set the CPU freq. and number of active cores

CPU frequencies

Governors:
There are several frequency governors which determine the frequency policy.
The default frequency governor is "ondemand", which sets the CPU frequency depending on the current system load.
(Note: the default governor is selected in the kernel defconfig. You can choose a different default governor using menuconfig before building the kernel - to reach this setting, go to: CPU Power Management -> CPU Frequency scaling -> Default CPUFreq governor)

To list all available governors:

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

To read about the different governors, see the following page from the Linux documentation:
https://github.com/varigit/linux-imx/blob/5.4-2.1.x-imx_var01/Documentation/admin-guide/pm/cpufreq.rst

To set the current governor:

# echo GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

(GOVERNOR being one of the available governors)

Useful commands:
To see the available CPU frequencies:

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies


To see the current CPU frequency:

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq


Common scenarios:
1. Use the default "ondemand" governor and limit the maximum allowed CPU freq. using the following commands:

To see the current maximum allowed CPU frequency:

# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq


To set the maximum allowed CPU frequency:

# echo FREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq

(FREQ being one of the available CPU frequencies)

2. Use the "userspace" governor and set the CPU to a specific frequency using the following command:

# echo FREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed

(FREQ being one of the available CPU frequencies)