305-300 · Question #11
Which file in a cgroup directory contains the list of processes belonging to this cgroup?
The correct answer is C. procs. The file procs in a cgroup directory contains the list of processes belonging to this cgroup. Each line in the file shows the PID of a process that is a member of the cgroup. A process can be moved to a cgroup by writing its PID into the cgroup's procs file. For example, to…
Question
Options
- Apids
- Bmembers
- Cprocs
- Dcasks
- Esubjects
How the community answered
(41 responses)- A2% (1)
- B12% (5)
- C76% (31)
- D7% (3)
- E2% (1)
Explanation
The file procs in a cgroup directory contains the list of processes belonging to this cgroup. Each line in the file shows the PID of a process that is a member of the cgroup. A process can be moved to a cgroup by writing its PID into the cgroup's procs file. For example, to move the process with PID 24982 to the cgroup cg1, the following command can be used: echo 24982 > /sys/fs/cgroup/cg1/procs. The file procs is different from the file tasks, which lists the threads belonging to the cgroup. The file procs can be used to move all threads in a thread group at once, while the file tasks can be used to move individual threads.
Topics
Community Discussion
No community discussion yet for this question.