Commit ca3b8ca0 authored by Pavel Emelyanov's avatar Pavel Emelyanov

dump: Comment how we dump zombies in pid namespaces

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 7c896eff
......@@ -1299,9 +1299,16 @@ static int fill_zombies_pids(struct pstree_item *item)
int i, nr;
pid_t *ch;
/*
* Pids read here are virtual -- caller has set up
* the proc of target pid namespace.
*/
if (parse_children(item->pid.virt, &ch, &nr) < 0)
return -1;
/*
* Step 1 -- filter our ch's pid of alive tasks
*/
list_for_each_entry(child, &item->children, sibling) {
if (child->pid.virt < 0)
continue;
......@@ -1313,6 +1320,12 @@ static int fill_zombies_pids(struct pstree_item *item)
}
}
/*
* Step 2 -- assign remaining pids from ch on
* children's items in arbitrary order. The caller
* will then re-read everything needed to dump
* zombies using newly obtained virtual pids.
*/
i = 0;
list_for_each_entry(child, &item->children, sibling) {
if (child->pid.virt > 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment