Cgroup
1. 基本操作
Mount cgroup
注:
Cgroup v1 named hierarchies
mount -t cgroup -o none,name=somename none /some/mount/point
Multiple instances of such hierarchies can be mounted; each hierarchy must have a unique name. The only purpose of such hierarchies is to track processes. (See the discussion of release notification below.) An example of this is the name=systemd cgroup hierarchy that is used by systemd(1) to track services and user sessions.
mount -t cgroup -o cpuset none /cpuset 中 none的作用
Certain filesystems aren't associated with a physical
device
(such as a partition or network share, which is what is expected at that point in themount
command) and it is/was customary to usenone
for these.
向task中增加pid
每次只能echo一个pid到task里
向task中减少pid
如果想把一个pid从某个cgroup task里移除,可以将它echo到另一个(比如:根cgroup)下即可,因为每个pid都必须属于某个cgroup管理。
参考资料
Cgroup(from Linux Programmer's Manual): http://man7.org/linux/man-pages/man7/cgroups.7.html
RedHat RESOURCE MANAGEMENT GUIDE: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/resource_management_guide/
Understanding the new control groups API: https://lwn.net/Articles/679786/
What does 'none' mean in “mount -t cgroup -o cpuset none /cpuset”: https://stackoverflow.com/questions/29674879/what-does-none-mean-in-mount-t-cgroup-o-cpuset-none-cpuset
Last updated