From d84e558ef3efd4731d22e0790e98abaaa389af44 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 10 Jan 2018 23:19:50 +0100 Subject: [PATCH] cgroups.7: Define containment rules for cgroup.threads Reviewed-by: Tejun Heo Signed-off-by: Michael Kerrisk --- man7/cgroups.7 | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/man7/cgroups.7 b/man7/cgroups.7 index aa3127a05..35f8bd634 100644 --- a/man7/cgroups.7 +++ b/man7/cgroups.7 @@ -1328,9 +1328,30 @@ to the files in different cgroups inside the subtree. The threads of a process must all reside in the same threaded subtree. .PP -The +As with writing to +.IR cgroup.procs , +some containment rules apply when writing to the .I cgroup.threads -file is writable only for the cgroups inside a threaded subtree. +file: +.IP * 3 +The writer must have write permission on the +cgroup.threads +file in the destination cgroup. +.IP * +The writer must have write permission on the +.I cgroup.procs +file in the common ancestor of the source and destination cgroups. +(In some cases, +the common ancestor may be the source or destination cgroup itself.) +.IP * +The source and destination cgroups must be in the same threaded subtree. +(Outside a threaded subtree, an attempt to move a thread by writing +its thread ID to the +.I cgroup.threads +file in a different +.I domain +cgroup fails with the error +.BR EOPNOTSUPP .) .PP The .I cgroup.threads