From: Roland McGrath <roland@redhat.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] signals: do_tkill: don't use tasklist_lock
Date: Fri, 7 Mar 2008 11:31:59 -0800 (PST) [thread overview]
Message-ID: <20080307193159.1AFF127010F@magilla.localdomain> (raw)
In-Reply-To: Oleg Nesterov's message of Friday, 7 March 2008 12:58:13 +0300 <20080307095813.GA8894@tv-sign.ru>
> Convert do_tkill() to use rcu_read_lock() + lock_task_sighand() to avoid
> taking tasklist lock.
That part looks good.
> Note that we don't return an error if lock_task_sighand() fails, we
> pretend the task dies after receiving the signal. Otherwise, we should
> fight with the nasty races with mt-exec without having any advantage.
To clarify, this is not a change from the existing behavior.
So your change is fine regardless of this issue.
The case you have in mind is that p was the old group_leader
being replaced by another thread that exec'd, right?
It is the most obscure of nits, but I think it can be wrong to drop a
signal in this case. If it's a fatal signal (especially SIGKILL),
then either the thread group should be killed or the call should
return an error.
For the exec case, if p->sighand is cleared that means the
release_task(leader) call at the end of de_thread started. So by
now, the pid has been transferred to the exec'ing thread. If we just
restart the lookup, it will find the new thread (or not, and we can
return -ESRCH).
I'm inclined to do that, but it certainly should be a second patch
after this one.
Thanks,
Roland
next prev parent reply other threads:[~2008-03-07 19:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-07 9:58 Oleg Nesterov
2008-03-07 10:50 ` Christoph Hellwig
2008-03-07 11:05 ` [PATCH] signals-do_tkill-dont-use-tasklist_lock-comment Oleg Nesterov
2008-03-07 19:31 ` Roland McGrath [this message]
2008-03-07 20:13 ` [PATCH] signals: do_tkill: don't use tasklist_lock Oleg Nesterov
2008-03-07 20:23 ` Oleg Nesterov
2008-03-07 21:19 ` Roland McGrath
2008-03-07 21:32 ` Oleg Nesterov
2008-03-07 21:51 ` Roland McGrath
2008-03-08 18:05 ` mt-exec && signals Oleg Nesterov
2008-03-11 2:41 ` Roland McGrath
-- strict thread matches above, loose matches on Subject: below --
2008-03-07 9:52 [PATCH] signals: do_tkill: don't use tasklist_lock 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=20080307193159.1AFF127010F@magilla.localdomain \
--to=roland@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
/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®