From: Ingo Molnar <mingo@elte.hu>
To: Roland McGrath <roland@redhat.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>, Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] de_thread: eliminate unneccessary sighand locking
Date: Tue, 28 Jun 2005 08:42:09 +0200 [thread overview]
Message-ID: <20050628064209.GA29540@elte.hu> (raw)
In-Reply-To: <200506280627.j5S6RBSd027251@magilla.sf.frob.com>
* Roland McGrath <roland@redhat.com> wrote:
> That is not the scenario. Something else must hold tasklist_lock
> while acquiring ourtask->sighand->siglock, but need not hold
> tasklist_lock throughout. Someone can be holding oldsighand->lock but
> not not tasklist_lock, at the time we lock tasklist_lock. So like I
> said, we need to hold oldsighand->siglock until the switch has been
> done.
>
> It's possible that no such scenarios exist, but I'd really have to
> check on that. My recollection is that there might be some.
i have checked it when acking the patch and it does not seem we do that
anywhere in the kernel. It would also be dangerous as per Oleg's
observations, unless something like this is done:
read_lock(&tasklist_lock);
p = find_task_by_pid(pid);
task_lock(p);
spin_lock(&p->sighand->siglock);
read_unlock(&tasklist_lock);
...
do you know any such code?
> > Just for my education, could you please point me to the existed example?
>
> It would require some auditing to hunt down whether they exist or
> don't. To make the change you suggest would require complete
> confidence none exist.
i have manually reviewed every .[ch] file that uses tasklist_lock,
siglock and lock_task:
fs/proc/array.c
fs/exec.c
kernel/ptrace.c
kernel/fork.c
kernel/exit.c
kernel/sys.c
include/linux/sched.h
security/selinux/hooks.c
can other valid locking variations exist, other than the one i outlined
above?
Ingo
next prev parent reply other threads:[~2005-06-28 6:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-19 16:13 [PATCH] de_thread: eliminate unneccessary sighand locking Oleg Nesterov
2005-06-28 1:50 ` Roland McGrath
2005-06-28 6:17 ` Oleg Nesterov
2005-06-28 6:27 ` Roland McGrath
2005-06-28 6:42 ` Ingo Molnar [this message]
2005-06-28 7:08 ` Roland McGrath
2005-06-28 7:16 ` Ingo Molnar
2005-06-28 7:26 ` Roland McGrath
2005-06-28 8:26 ` Ingo Molnar
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=20050628064209.GA29540@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@tv-sign.ru \
--cc=roland@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.