From: Oleg Nesterov <oleg@tv-sign.ru>
To: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
"Paul E. McKenney" <paulmck@us.ibm.com>,
David Howells <dhowells@redhat.com>
Subject: Re: [PATCH 2/6] relax sig_needs_tasklist()
Date: Sat, 25 Feb 2006 23:06:47 +0300 [thread overview]
Message-ID: <4400B8D7.BE68EEDF@tv-sign.ru> (raw)
In-Reply-To: m1r75r1kh9.fsf@ebiederm.dsl.xmission.com
Eric W. Biederman wrote:
>
> Oleg Nesterov <oleg@tv-sign.ru> writes:
>
> > handle_stop_signal() does not need tasklist_lock for
> > SIG_KERNEL_STOP_MASK signals anymore.
>
> Small question.
>
> If I read the code correctly the only thing handle_stop_signal needs
> the tasklist_lock for is to protect task->parent, for the
> do_notify_parent_cldstop(...) case.
Yes, exactly.
> If this is correct. I think I see a path to kill read_lock(&tasklist_lock)
> completely.
>
> - Protect task->parent with the rcu_read_lock && task_lock().
> - Use the rcu forms of list_add/list_del on the tasklist.
> - replace read_lock(&tasklist_lock) with rcu_read_lock().
> - Make tasklist_lock a simple spin lock.
>
> Comments?
I must admit, I am not brave enough to even think about this
now :)
I already thought about protecting ->parent with task_lock(),
but I can't find a reasonable solution.
As for handle_stop_signal(), there is another problem.
do_notify_parent_cldstop takes ->parent's sighand->siglock, so
the caller drops child's. And this is possible only because we
are holding tasklist_lock.
Somehow we need to lock both the parent and the child, and what
if child does ptrace on it's ->real_parent?
Oleg.
prev parent reply other threads:[~2006-02-25 20:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-22 23:04 [PATCH 2/6] relax sig_needs_tasklist() Oleg Nesterov
2006-02-25 16:17 ` Eric W. Biederman
2006-02-25 20:06 ` Oleg Nesterov [this message]
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=4400B8D7.BE68EEDF@tv-sign.ru \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulmck@us.ibm.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;
as well as URLs for NNTP newsgroup(s).