From: Ingo Molnar <mingo@elte.hu>
To: "Paul E. McKenney" <paulmck@us.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>,
Dipankar Sarma <dipankar@in.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [RFC,PATCH] Use RCU to protect tasklist for unicast signals
Date: Wed, 17 Aug 2005 08:35:44 +0200 [thread overview]
Message-ID: <20050817063544.GA6519@elte.hu> (raw)
In-Reply-To: <20050817014857.GA3192@us.ibm.com>
* Paul E. McKenney <paulmck@us.ibm.com> wrote:
> My tests are not finding even glaring races, so time to go and create
> some torture tests before getting too much more elaborate. 10,000
> eyes are nice (and Oleg's eyes do seem to be working especially well),
> but a good software-test sledgehammer has its uses as well.
i've merged this to the -rt tree, and find below a delta patch relative
to the previous patch.
Ingo
Index: linux/kernel/exit.c
===================================================================
--- linux.orig/kernel/exit.c
+++ linux/kernel/exit.c
@@ -74,7 +74,6 @@ repeat:
__ptrace_unlink(p);
BUG_ON(!list_empty(&p->ptrace_list) || !list_empty(&p->ptrace_children));
__exit_signal(p);
- __exit_sighand(p);
/*
* Note that the fastpath in sys_times depends on __exit_signal having
* updated the counters before a task is removed from the tasklist of
Index: linux/kernel/signal.c
===================================================================
--- linux.orig/kernel/signal.c
+++ linux/kernel/signal.c
@@ -328,17 +328,19 @@ void __exit_sighand(struct task_struct *
struct sighand_struct * sighand = tsk->sighand;
/* Ok, we're done with the signal handlers */
- spin_lock(&sighand->siglock);
tsk->sighand = NULL;
if (atomic_dec_and_test(&sighand->count))
sighand_free(sighand);
- spin_unlock(&sighand->siglock);
}
void exit_sighand(struct task_struct *tsk)
{
write_lock_irq(&tasklist_lock);
- __exit_sighand(tsk);
+ spin_lock(&tsk->sighand->siglock);
+ if (tsk->sighand != NULL) {
+ __exit_sighand(tsk);
+ }
+ spin_unlock(&tsk->sighand->siglock);
write_unlock_irq(&tasklist_lock);
}
@@ -361,6 +363,7 @@ void __exit_signal(struct task_struct *t
if (tsk == sig->curr_target)
sig->curr_target = next_thread(tsk);
tsk->signal = NULL;
+ __exit_sighand(tsk);
spin_unlock(&sighand->siglock);
flush_sigqueue(&sig->shared_pending);
} else {
@@ -392,6 +395,7 @@ void __exit_signal(struct task_struct *t
sig->nvcsw += tsk->nvcsw;
sig->nivcsw += tsk->nivcsw;
sig->sched_time += tsk->sched_time;
+ __exit_sighand(tsk);
spin_unlock(&sighand->siglock);
sig = NULL; /* Marker for below. */
}
next prev parent reply other threads:[~2005-08-17 6:35 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-11 12:16 [RFC,PATCH] Use RCU to protect tasklist for unicast signals Oleg Nesterov
2005-08-11 15:20 ` Paul E. McKenney
2005-08-12 1:56 ` Paul E. McKenney
2005-08-12 8:51 ` Oleg Nesterov
2005-08-12 15:42 ` Paul E. McKenney
2005-08-15 17:44 ` Paul E. McKenney
2005-08-16 8:14 ` Ingo Molnar
2005-08-16 11:56 ` Oleg Nesterov
2005-08-16 17:07 ` Paul E. McKenney
2005-08-17 1:48 ` Paul E. McKenney
2005-08-17 6:35 ` Ingo Molnar [this message]
2005-08-17 14:35 ` Oleg Nesterov
2005-08-17 21:19 ` Paul E. McKenney
2005-08-18 11:48 ` Oleg Nesterov
2005-08-19 1:29 ` Paul E. McKenney
2005-08-19 13:27 ` Oleg Nesterov
2005-08-19 18:34 ` Paul E. McKenney
2005-08-18 12:24 ` Oleg Nesterov
-- strict thread matches above, loose matches on Subject: below --
2005-08-10 17:11 Paul E. McKenney
2005-08-11 9:56 ` Ingo Molnar
2005-08-11 14:14 ` Paul E. McKenney
2005-08-12 2:00 ` Lee Revell
2005-08-12 6:36 ` Ingo Molnar
2005-08-12 20:57 ` Paul E. McKenney
2005-08-11 17:14 ` Christoph Hellwig
2005-08-11 17:56 ` Paul E. McKenney
2005-08-11 18:00 ` Dipankar Sarma
2005-08-11 18:12 ` Dipankar Sarma
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=20050817063544.GA6519@elte.hu \
--to=mingo@elte.hu \
--cc=dipankar@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@tv-sign.ru \
--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 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.