[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20081204171430.GA16728@redhat.com>
Date: Thu, 4 Dec 2008 18:14:30 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Roland McGrath <roland@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
Pavel Emelyanov <xemul@...nvz.org>,
"Serge E. Hallyn" <serue@...ibm.com>,
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] processes: reparent_thread: don't call
kill_orphaned_pgrp() if task_detached()
On 11/26, Roland McGrath wrote:
>
> > @@ -816,6 +816,8 @@ static void reparent_thread(struct task_
> >
> > list_move_tail(&p->sibling, &p->real_parent->children);
> >
> > + if (task_detached(p))
> > + return;
>
> Seems like it would be cleaner to reorganize the code a little.
> reparent_thread has only one caller. How about we move:
>
> if (p->pdeath_signal)
> /* We already hold the tasklist_lock here. */
> group_send_sig_info(p->pdeath_signal, SEND_SIG_NOINFO, p);
>
> list_move_tail(&p->sibling, &p->real_parent->children);
>
> into forget_original_parent and rename reparent_thread to something else,
> called only:
>
> if (!task_detached(p) && !same_thread_group(p->real_parent, father))
> orphaned_process(p);
Not that I think this really matters, but imho this code needs more
little trivial reorganizations.
reparent_thread() (or whatever) needs the "&ptrace_dead" parameter
too, if the new parent (init) ignores SIGCHLD we should release a
zombie. So we should rename "ptrace_dead" and ptrace_exit_finish().
And imho it makes sense to create the new helper which does
"list_for_each_entry_safe(father->children) {}", to make this code
more symmetrical() with ptrace_exit().
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists