R-Car/Boards/Yocto-Gen3-CommonFAQ/Is it possible to use specific CPU core to run the specific application?
Is it possible to use specific CPU core to run the specific application?
There are several methods of realizing processor affiity under Linux.
This FAQ descrives how to apply cgroup.
- Creating the big(CA57) and little(CA53) group
root@m3ulcb:~# mkdir /sys/fs/cgroup/cpuset/big root@m3ulcb:~# mkdir /sys/fs/cgroup/cpuset/little
- Setting the memory node
- If you do not wish to specify the assignment of memory, set it to 0 as in our example.
root@m3ulcb:~# echo 0 > /sys/fs/cgroup/cpuset/big/cpuset.mems root@m3ulcb:~# echo 0 > /sys/fs/cgroup/cpuset/little/cpuset.mems
- Assigning CPU resources to the groups
- Case of R-Car Starter Kit Pro(M3):
root@m3ulcb:~# echo 0-1 > /sys/fs/cgroup/cpuset/big/cpuset.cpus root@m3ulcb:~# echo 2-5 > /sys/fs/cgroup/cpuset/little/cpuset.cpus
- Confirming the PIDs of applications
root@m3ulcb:~# ps
- Assigning the applications
root@m3ulcb:~# echo [PID] > /sys/fs/cgroup/cpuset/big/tasks root@m3ulcb:~# echo [PID] > /sys/fs/cgroup/cpuset/little/tasks
- Release from assignment to the big or little group
root@m3ulcb:~# echo [PID] > /sys/fs/cgroup/cpuset/tasks