aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/proc.txt
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2012-05-31 19:26:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-31 20:49:32 -0400
commit818411616baf46ceba0cff6f05af3a9b294734f7 (patch)
treeb6e338e20d4a45b6a05ffa37e6af33e0cc1b50c0 /Documentation/filesystems/proc.txt
parent98ed57eef9f67dfe541be0bca34660ffc88365b2 (diff)
fs, proc: introduce /proc/<pid>/task/<tid>/children entry
When we do checkpoint of a task we need to know the list of children the task, has but there is no easy and fast way to generate reverse parent->children chain from arbitrary <pid> (while a parent pid is provided in "PPid" field of /proc/<pid>/status). So instead of walking over all pids in the system (creating one big process tree in memory, just to figure out which children a task has) -- we add explicit /proc/<pid>/task/<tid>/children entry, because the kernel already has this kind of information but it is not yet exported. This is a first level children, not the whole process tree. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Reviewed-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Kees Cook <keescook@chromium.org> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Serge Hallyn <serge.hallyn@canonical.com> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/filesystems/proc.txt')
-rw-r--r--Documentation/filesystems/proc.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index 912af6ce5626..d8d3f9a8e5a3 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -40,6 +40,7 @@ Table of Contents
40 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings 40 3.4 /proc/<pid>/coredump_filter - Core dump filtering settings
41 3.5 /proc/<pid>/mountinfo - Information about mounts 41 3.5 /proc/<pid>/mountinfo - Information about mounts
42 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm 42 3.6 /proc/<pid>/comm & /proc/<pid>/task/<tid>/comm
43 3.7 /proc/<pid>/task/<tid>/children - Information about task children
43 44
44 4 Configuring procfs 45 4 Configuring procfs
45 4.1 Mount options 46 4.1 Mount options
@@ -1578,6 +1579,23 @@ then the kernel's TASK_COMM_LEN (currently 16 chars) will result in a truncated
1578comm value. 1579comm value.
1579 1580
1580 1581
15823.7 /proc/<pid>/task/<tid>/children - Information about task children
1583-------------------------------------------------------------------------
1584This file provides a fast way to retrieve first level children pids
1585of a task pointed by <pid>/<tid> pair. The format is a space separated
1586stream of pids.
1587
1588Note the "first level" here -- if a child has own children they will
1589not be listed here, one needs to read /proc/<children-pid>/task/<tid>/children
1590to obtain the descendants.
1591
1592Since this interface is intended to be fast and cheap it doesn't
1593guarantee to provide precise results and some children might be
1594skipped, especially if they've exited right after we printed their
1595pids, so one need to either stop or freeze processes being inspected
1596if precise results are needed.
1597
1598
1581------------------------------------------------------------------------------ 1599------------------------------------------------------------------------------
1582Configuring procfs 1600Configuring procfs
1583------------------------------------------------------------------------------ 1601------------------------------------------------------------------------------