From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Pavel Emelyanov <xemul@openvz.org>, linux-kernel@vger.kernel.org
Subject: Re: rfc, leader_pid_type()
Date: Wed, 19 Mar 2008 01:15:52 +0300 [thread overview]
Message-ID: <20080318221552.GA143@tv-sign.ru> (raw)
In-Reply-To: <m18x0fvh5d.fsf@ebiederm.dsl.xmission.com>
On 03/18, Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@tv-sign.ru> writes:
>
> > Eric, Pavel.
> >
> > Without tasklist lock held, task_tgid/task_pgrp/task_session can return the
> > bogus NULL. Note that the last 2 can return NULL even if task == current.
> >
> > What do you think if we add yet another helper?
>
> My current inclination is this places the cost for de_thread in the
> wrong place. exec on a threaded binary should be rare.
> Any chance we can make de_thread rcu safe?
>
> We are very close.
>
> It would take a double check but I believe all we need to do is to
> modify detach_pid to remove link->pid. This of course messes up
> pid_alive but otherwise we should be ok if we have a big fat comment.
Not sure I understand... detach_pid(type) already sets
task->pids[type].pid = NULL;
> We might need to replace the detach_pid, attach_pid sequence in
> __set_special_pids with an optimized sequence like transfer_pid
> call it replace_pid where we guarantee there is always a valid pid
> pointer in the group_leader.
OK... I think you are right... good point.
> It just feels wrong to me to put cost (and worse complexity) for
> handling the very rare cases in much more common code paths.
Absolutely agreed.
> > Yes, we already have a lot helpers... The one potential user is
> > check_kill_permission(), but it can live without it.
>
> I think it is worth removing the pain of using de_thread if we can.
Agreed, but how? de_thread() must remove the old leader from
->pids[type].node before it does release_task(leader).
(i do remember your idea to _not_ switch ->group_leader on exec,
it solves sooo many problems...)
Oleg.
next prev parent reply other threads:[~2008-03-19 22:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-18 15:38 Oleg Nesterov
[not found] ` <m18x0fvh5d.fsf@ebiederm.dsl.xmission.com>
2008-03-18 22:15 ` Oleg Nesterov [this message]
[not found] ` <m13aqnvdnk.fsf@ebiederm.dsl.xmission.com>
2008-03-19 0:31 ` Oleg Nesterov
2008-03-19 14:36 ` 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=20080318221552.GA143@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®