From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] forget_original_parent: cleanup ptrace pathes
Date: Tue, 10 Feb 2009 15:23:24 -0800 (PST) [thread overview]
Message-ID: <20090210232324.399ADFC3DB@magilla.sf.frob.com> (raw)
In-Reply-To: Oleg Nesterov's message of Tuesday, 10 February 2009 23:47:51 +0100 <20090210224751.GA9478@redhat.com>
> It doesn't really hurt, but a bit ugly. Imho.
Agreed.
> How about below? Modulo comments and some other cleanups. For example,
> I think it is better to move the changing of ->real_parent into
> reparent_thread().
The exact split between reparent_thread and forget_original_parent (and
their names) never made much sense to me.
If ptrace_exit does its own lock/unlock, then it could move much earlier.
I'd be inclined to do it right before exit_signals(). But it should at
least short-circuit and not lock for list_empty(->ptraced), so we're not
adding a whole lock_irq/unlock_irq to the common case of no ptrace use.
> xxx = &p->real_parent->children;
> if (reparent_thread(father, p))
> xxx = &child_dead;
> list_move_tail(&p->sibling, xxx);;
I'd thought of this before. But I didn't mention it because I was afraid
to wonder what might care about the use of ->sibling. It really looks like
nothing does. This is clearly the clean and nice way to go if there is no
problem with it.
This change and moving ptrace_exit around should probably be separate patches.
Thanks,
Roland
next prev parent reply other threads:[~2009-02-10 23:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-29 8:06 Oleg Nesterov
2009-02-05 2:40 ` Roland McGrath
2009-02-05 15:33 ` Oleg Nesterov
2009-02-09 2:36 ` Roland McGrath
2009-02-10 22:47 ` Oleg Nesterov
2009-02-10 23:23 ` Roland McGrath [this message]
2009-02-10 23:40 ` Oleg Nesterov
2009-02-10 23:53 ` Roland McGrath
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=20090210232324.399ADFC3DB@magilla.sf.frob.com \
--to=roland@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
/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
Powered by JetHome