The Linux kernel supports the cpu-hotplug mechanism. You can enable or disable the CPU or CPU core without rebooting the system. Not only is CPU hotplug useful for replacing defective components, but it can also be used in other contexts to increase the productivity of a system.
The i.MX8QM/i.MX8QXP SoC can have multiple processor cores on the die. To see all available cores in the system, execute:
Code Block |
---|
|
$ ls /sys/devices/system/cpu -1 |
The output:
Code Block |
---|
|
cpu0 cpu1 cpu2 cpu3 cpufreq
[...] |
By default, all available cores in the system are enabled. To switch off any single core, execute:
Code Block |
---|
|
$ echo 0 > /sys/devices/system/cpu/cpu2/online |
To power up the core again, execute:
Code Block |
---|
|
$ echo 1 > /sys/devices/system/cpu/cpu2/online |