CPU cores¶
There are two ways to disable/enable CPU cores:
- Add
maxcpus=n(nbeing the number of cores you wish to activate) to the kernel command line (the bootargs from U-Boot). E.g. assuming you are using our latest U-Boot, stop at the U-Boot command line and enter:
- To disable/enable cores at kernel runtime: Disable core X:
Enable core X:
X is the core number you want to enable/disable, and can range from
1 to (number of actual CPU cores)-1 (cpu0 is always enabled).
To see the active cores, run:
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:
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:
(GOVERNOR being one of the available governors)
Useful commands: To see the available CPU frequencies:
To see the current CPU frequency:
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:
To set the maximum allowed CPU frequency:
(FREQ being one of the available CPU frequencies)
- Use the
userspacegovernor and set the CPU to a specific frequency using the following command:
(FREQ being one of the available CPU frequencies)