aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2016-10-07 13:10:31 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2016-10-07 23:01:35 +0200
commit87402a2e5bb1f14f63ae20e3c00b4165d8b91c69 (patch)
tree3cae172f02404e09a8175ba3135bd5fd4dcb09a9
parent9ed582ac20ca50521ccba9e7d78468354497920d (diff)
downloadman-pages-87402a2e5bb1f14f63ae20e3c00b4165d8b91c69.tar.gz
cgroups.7: Clarify discussion of the "tasks" file
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man7/cgroups.722
1 files changed, 17 insertions, 5 deletions
diff --git a/man7/cgroups.7 b/man7/cgroups.7
index e6cbbd08b5..f80fe6282f 100644
--- a/man7/cgroups.7
+++ b/man7/cgroups.7
@@ -222,20 +222,32 @@ A new cgroup is created by creating a directory in the cgroup filesystem:
mkdir /sys/fs/cgroup/cpu/cg1
This creates a new empty cgroup.
-Processes (threads) may be moved to this cgroup by writing
-their PIDs (TIDs) into the cgroup's
+Processes may be moved to this cgroup by writing
+their PIDs into the cgroup's
.I cgroup.procs
-.RI ( tasks )
file:
echo $$ > /sys/fs/cgroup/cpu/cg1/cgroup.procs
-The same files can be read to obtain a list of the processes (threads)
+The same file can be read to obtain a list of the processes
that are currently in
.IR cg1 .
When writing a PID into the
.IR cgroup.procs ,
-all tasks in the process are moved into the new cgroup at once.
+all threads in the process are moved into the new cgroup at once.
+
+In cgroups v1 (but not cgroups v2), an individual thread can be moved to
+another cgroup by writing its thread ID
+(i.e., the kernel thread ID returned by
+.BR clone (2)
+and
+.BR gettid (2))
+to the
+.IR tasks
+file in a cgroup directory.
+This file can be read to discover the set of threads
+that are members of the cgroup.
+This file is not present in cgroup v2 directories.
A child process created via
.BR fork (2)