CPU sets to build software - useful for CPUs using "big.LITTLE" architecture where some cores are faster than others.
E.g. on my RockPRO64 that has 2 big cores up to 2.0 GHz and 4 smaller ones at 1.4 GHz:
Find out which cores are faster (Cortex-A72) and slower (Cortex-A53):
dmesg | grep cpu
[ 1.000000] cpu0 at cpus0: Arm Cortex-A53 r0p4 (v8-A), id 0x0
[ 1.000000] cpu1 at cpus0: Arm Cortex-A53 r0p4 (v8-A), id 0x1
[ 1.000000] cpufreqdt1 at cpu1
[ 1.000000] cpu2 at cpus0: Arm Cortex-A53 r0p4 (v8-A), id 0x2
[ 1.000000] cpufreqdt2 at cpu2
[ 1.000000] cpu3 at cpus0: Arm Cortex-A53 r0p4 (v8-A), id 0x3
[ 1.000000] cpufreqdt3 at cpu3
[ 1.000000] cpu4 at cpus0: Arm Cortex-A72 r0p2 (v8-A), id 0x100
[ 1.000000] cpufreqdt4 at cpu4
[ 1.000000] cpu5 at cpus0: Arm Cortex-A72 r0p2 (v8-A), id 0x101
List CPU sets
psrset
system processor set 0: processor(s) 0 1 2 3 4 5
Create a new CPU set with the 2 faster cores (4 & 5)
psrset -c 4 5
1
List CPU sets (note the newly created CPU set with id 1)
psrset
system processor set 0: processor(s) 0 1 2 3
user processor set 1: processor(s) 4 5
We can now build software only using the 2 faster cores and leaving the 4 slower cores available for user input etc.
psrset -e 1 make install clean -j 2
Don't forget to delete the newly created CPU set after building as it removes the specified cores away from the default CPU set:
psrset -d 1