From: Oleg Nesterov <oleg@redhat.com>
To: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Emelyanov <xemul@openvz.org>,
"Serge E. Hallyn" <serue@us.ibm.com>,
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] processes: reparent_thread: don't call kill_orphaned_pgrp() if task_detached()
Date: Thu, 4 Dec 2008 18:14:30 +0100 [thread overview]
Message-ID: <20081204171430.GA16728@redhat.com> (raw)
In-Reply-To: <20081204005203.95F6FFC3C0@magilla.sf.frob.com>
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.
next prev parent reply other threads:[~2008-12-04 17:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-18 17:59 [PATCH 1/2] protect /sbin/init from unwanted signals more Oleg Nesterov
2008-11-19 18:51 ` Roland McGrath
2008-11-20 2:00 ` Eric W. Biederman
2008-11-20 3:04 ` Roland McGrath
2008-11-20 14:52 ` Oleg Nesterov
2008-11-20 18:10 ` Eric W. Biederman
2008-11-20 20:00 ` Oleg Nesterov
2008-11-20 20:28 ` [PATCH] processes: reparent_thread: don't call kill_orphaned_pgrp() if task_detached() Oleg Nesterov
2008-11-26 20:21 ` Roland McGrath
2008-12-04 17:14 ` Oleg Nesterov [this message]
2008-12-04 1:06 ` Roland McGrath
2008-11-20 15:20 ` [PATCH 1/2] protect /sbin/init from unwanted signals more Oleg Nesterov
2008-11-20 21:24 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081204171430.GA16728@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.com \
--cc=serue@us.ibm.com \
--cc=sukadev@linux.vnet.ibm.com \
--cc=xemul@openvz.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox