fs, proc: introduce /proc/<pid>/task/<tid>/children entry
authorCyrill Gorcunov <[email protected]>
Thu, 31 May 2012 23:26:43 +0000 (16:26 -0700)
committerLinus Torvalds <[email protected]>
Fri, 1 Jun 2012 00:49:32 +0000 (17:49 -0700)
commit818411616baf46ceba0cff6f05af3a9b294734f7
treeb6e338e20d4a45b6a05ffa37e6af33e0cc1b50c0
parent98ed57eef9f67dfe541be0bca34660ffc88365b2
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 <[email protected]>
Reviewed-by: Oleg Nesterov <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: KAMEZAWA Hiroyuki <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Documentation/filesystems/proc.txt
fs/proc/array.c
fs/proc/base.c
fs/proc/internal.h