Skip to content
Commit 42205175 authored by Andrew Vagin's avatar Andrew Vagin Committed by Pavel Emelyanov
Browse files

pstree: use rbtree to find a specified pid (v3)



Currently we enumirate all children of the init task and
if a task isn't a session leader, we create a helper,
collect all children with this sid to the children list of this helper.

When all children of the init task has been enumirated, we try to find
a session leader for each helper.

We use this way to enumirate all tasks only once.

Now we are going to collect all tasks in rbtree, so we can find
a sessial leader when we need it. It will not affect performance,
because without searching a session leader, we can't add a helper
to the tree.

v2: rename lookup_pid to pstree_pid_by_virt
    use pstree_pid_by_virt in pstree_item_by_virt
v3: handle session leaders in this patch too

Signed-off-by: default avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 7f9961b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment