????root@ubuntu:~# ps -C a.out -opid??%cpu??psr??args
????PID %CPU PSR COMMAND
????3944 33.6   3 ./a.out
????3945 66.4   3 ./a.out
???????????????????
????[html] view plaincopy
????sina@ubuntu:~$ ./a.out &
????[2] 5503
????????cpu??????? ??
????root@ubuntu:~# ps -C a.out -opid??%cpu??psr??args
????PID %CPU PSR COMMAND
????5503 99.6   1 ./a.out
???????????? 5503 ??? cpu?????У??????????cpu??????
????root@ubuntu:/sys/fs/cgroup/cpu/tailor# echo 5503 > tasks
?????????????????仯???????????????????? ?????cpu affinity ?????
????root@ubuntu:~# ps -C a.out -opid??%cpu??psr??args
????PID %CPU PSR COMMAND
????3944 33.6   3 ./a.out
????3945 66.4   3 ./a.out
????5503 99.6   1 ./a.out
??????????? 5503 ??? cpuset ?????У??????????cpu??????
????root@ubuntu:/sys/fs/cgroup/cpuset/tailor# echo 5503 > tasks
????root@ubuntu:~# ps -C a.out -opid??%cpu??psr??args
????PID %CPU PSR COMMAND
????3944 33.4   3 ./a.out
????3945 33.3   3 ./a.out
????5503 33.3  3 ./a.out
?????????????????????????????????? cgroup ??????????????? cpu.shares ?趨?????????CPU?????????????cgroup?е??????????????????
???????????? cpu.rt_period_us ?? cpu.rt_runtime_us ??????CPU????????
????[html] view plaincopy
????root@ubuntu:/sys/fs/cgroup/cpu/tailor# echo 200000 > cpu.rt_runtime_us
??????????????? 3 ?????cpu??????
????root@ubuntu:~# ps -C a.out -opid??%cpu??psr??args
????PID %CPU PSR COMMAND
????3944 33.4   3 ./a.out
????3945 10.0   3 ./a.out
????5503 9.9   3 ./a.out
????????????????????   ????  cpu.rt_runtime_us   ??  cpu.rt_period_us  ???? ????CPU??????????????????????????????????ù????CPU?????