$ taskset -p 1 30767
pid 30767's current affinity mask: 1
pid 30767's new affinity mask: 1
taskset的实现是调用了:
sched_setaffinity, sched_getaffinity - set and get a process’s CPU affinity mask
通过下面命令查询状态:
$ cat /proc/30767/status |grep allow
Cpus_allowed: 01
Cpus_allowed_list: 0