taskset
taskset
usage: taskset [-ap] [mask] [PID | cmd [args...]]
Launch a new task which may only run on certain processors, or change
the processor affinity of an exisitng PID.
Mask is a hex string where each bit represents a processor the process
is allowed to run on. PID without a mask displays existing affinity.
-p Set/get the affinity of given PID instead of a new command.
-a Set/get the affinity of all threads of the PID.
taskset: Needs 1 argument
taskset可以设置单个线程或者某个进程的所有线程的CPU亲和属性
- RK3399的大核mask为30,如果希望执行进程在大核,那么使用命令 taskset -ap 30 【pid】即可
- 如果希望设置单个线程的亲和属性,先通过ps -p [PID] -t获得线程pid,然后去掉-a的参数就可以