]> git.karo-electronics.de Git - karo-tx-linux.git/commit
fs, proc: introduce /proc/<pid>/task/<tid>/children entry
authorCyrill Gorcunov <gorcunov@openvz.org>
Wed, 25 Apr 2012 01:04:52 +0000 (11:04 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 30 Apr 2012 05:17:43 +0000 (15:17 +1000)
commit04907d32523bce3ed2608f9c17aee1ac6ac6af13
treef2d8cfd769c9a034628d5792ac09d54417b60878
parentad51d728ad2894ec8479e99ce79d216333668e03
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>
Documentation/filesystems/proc.txt
fs/proc/array.c
fs/proc/base.c
fs/proc/internal.h