On Fri, Aug 19, 2011 at 14:25, Oleg Nesterov <oleg@xxxxxxxxxx> wrote: > On 08/19, Kay Sievers wrote: >> + /* find the first ancestor marked as child_subreaper */ >> + for (reaper = father->real_parent; >> + reaper != reaper->real_parent; > > This looks mysterious. This relies on the fact that INIT_TASK(tsk) > sets .real_parent = tsk. "reaper != &init_task" looks much more clean. > > But. Now that you check ->has_child_subreaper before the lookup, > this problem should go away? I mean, if ->has_child_subreaper == T > then some of our parents is the userspace task. Even if it was > spawned by kthread and then exited, we can't miss ->child_reaper > in the parents chain. That's right. We only ever look at 'flagged' processes now, and no other than a userspace process can ever be tagged. We can just walk up to ->child_reaper. > Or I missed something? I think that's right. I'll test it. >> + case PR_SET_CHILD_SUBREAPER: >> + me->signal->is_child_subreaper = !!arg2; >> + me->signal->has_child_subreaper = true; > > Hmm. This looks wrong... why do we set ->has_child_subreaper? That's the flag we pass down to our childs, hence we need to set it here. Kay -- To unsubscribe from this list: send the line "unsubscribe linux-man" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html