retrieve or set a process’s CPU affinity
1
用法:taskset [选项] [掩码 | cpu列表] [pid|命令 [参数...]]
1234
[root@hgs ~]# ./test.sh &[1] 12787[root@hgs ~]# taskset -p 12787pid 12787's current affinity mask: ffffffffffffff
14个f,表示有14 x 4 = 56个处理器。
12345
[root@hgs ~]# taskset -p 3 12787pid 12787's current affinity mask: ffffffffffffffpid 12787's new affinity mask: 3[root@hgs ~]# taskset -pc 12787pid 12787's current affinity list: 0,1
[root@hgs ~]# taskset -pc 0,3,7-11 12787pid 12787's current affinity list: 0,1pid 12787's new affinity list: 0,3,7-11[root@hgs ~]# taskset -p 12787pid 12787's current affinity mask: f89
0xf89 = 0b1111 1000 1001