lkml.org 
[lkml]   [2011]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: + prctl-add-pr_setget_child_reaper-to-allow-simple-process-supervision .patch added to -mm tree
Hello Kay,

I need to go away, I'll read this patch (and the whole email) tomorrow.

Just a quick note right now,

On 08/18, Kay Sievers wrote:
>
> static struct task_struct *find_new_reaper(struct task_struct *father)
> __releases(&tasklist_lock)
> @@ -724,6 +725,19 @@ static struct task_struct *find_new_reap
> * forget_original_parent() must move them somewhere.
> */
> pid_ns->child_reaper = init_pid_ns.child_reaper;
> + } else {
> + /* find the first ancestor which is marked as child_reaper */
> + for (thread = father->real_parent;
> + thread != thread->real_parent;
> + thread = thread->real_parent) {
> + if (thread == pid_ns->child_reaper)
> + break;
> + if (!thread->signal->child_reaper)
> + continue;
> + if (thread->flags & PF_EXITING)
> + continue;
> + return thread;

No, this doesn't look right.

This code should do something like

for (reaper = father->real_parent;
!same_thread_group(reaper, pid_ns->child_reaper);
reaper = reaper->real_parent) {
if (!signal->child_reaper)
continue;

if (there is a !PF_EXITING thread)
return thread;
}

And I forgot to mention, could you please-please rename child_reaper?
Say, is_child_reaper or is_sub_reaper. Or whatever. I do not really
care about the naming. But I use grep very often, and personally I
dislike the task->child_reaper/signal->child_reaper confusion.

Oleg.



\
 
 \ /
  Last update: 2011-08-18 20:55    [W:0.866 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site