????1.???????
???????μ??????Linux????3.2.6????cgroup?????????????????????????????????????????Cgroup?ж???CPU???????????????cpu??cpuset????????????????cpu?????????????????????????y??????CPU?????????cpuset?????????????????????ЩCPU???????(NUMA)??
??????????????????  cgroup ?? cpu ??cpuset??????????????????????????cpu.shares??cpu.rt_period_us ??cpu.rt_runtime_us ????????????÷?????
????2.????????
ubuntu 11.10
3.0.0-26-generic-pae
4  Intel(R) Core(TM) i3-2310M CPU @ 2.10GHz
????3.???????
?????????
mount -t tmpfs cgroup_root /sys/fs/cgroup
mkdir /sys/fs/cgroup/cpuset
mount -t cgroup -ocpuset cpuset /sys/fs/cgroup/cpuset
????????????
????root@ubuntu:/sys/fs/cgroup/cpuset# mkdir tailor tinker
???????? ??
????root@ubuntu:~# mount -t cgroup -o cpu none /sys/fs/cgroup/cpu
????????????
????root@ubuntu:/sys/fs/cgroup/cpu# mkdir tailor tinker
??????????????????
????sina@ubuntu:~$ ./a.out &
????[2] 3944
????sina@ubuntu:~$ ./a.out &
????[2] 3945
??????????????? cpu cpuset??????棺
????sina@ubuntu:/sys/fs/cgroup/cpuset/tinker$ echo 3944 > tasks
????sina@ubuntu:/sys/fs/cgroup/cpuset/tailor$ echo 3945 > tasks
????sina@ubuntu:/sys/fs/cgroup/cpu/tailor$ echo 3945 > tasks
????sina@ubuntu:/sys/fs/cgroup/cpu/tinker$ echo 3944 > tasks
???????? cpu???????? cpu.shares
????[html] view plaincopy
????sina@ubuntu:/sys/fs/cgroup/cpu/tailor$ echo 1024 > cpu.shares
????sina@ubuntu:/sys/fs/cgroup/cpu/tinker$ echo 512 > cpu.shares
???????????????cpu affinity??
????sina@ubuntu:/sys/fs/cgroup/cpuset/tailor$ echo 3 > cpuset.cpus
????sina@ubuntu:/sys/fs/cgroup/cpuset/tinker$ echo 3 > cpuset.cpus
???????????????cpu??????????? ??????????????????????ò?????????????