public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix SIGSTOP locking issue in -rt
@ 2005-11-01 19:58 Paul E. McKenney
  2005-11-02 13:11 ` Ingo Molnar
  0 siblings, 1 reply; 2+ messages in thread
From: Paul E. McKenney @ 2005-11-01 19:58 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel, akpm, oleg

Hello!

The following patch fixes a locking issue in -rt signals, where the
job-control signals drop sighand_lock momentarily during signal handling.
This interacts badly with the RCU-ification of unicast signal delivery.
The fix is simply to acquire tasklist_lock for job-control signals, since
these typically do not have stringent scalability or latency requirements.

These same changes would be useful in recent -mm.

Signed-off-by: <paulmck@us.ibm.com>

---

 signal.c |    8 ++++++++
 1 files changed, 8 insertions(+)

diff -urpNa -X dontdiff linux-2.6.14-rc5-rt2-ckhandRCUfix/kernel/signal.c linux-2.6.14-rc5-rt2-SIGSTOP/kernel/signal.c
--- linux-2.6.14-rc5-rt2-ckhandRCUfix/kernel/signal.c	2005-10-31 22:28:45.000000000 -0800
+++ linux-2.6.14-rc5-rt2-SIGSTOP/kernel/signal.c	2005-11-01 09:32:29.000000000 -0800
@@ -1207,13 +1207,21 @@ int
 kill_proc_info(int sig, struct siginfo *info, pid_t pid)
 {
 	int error;
+	int acquired_tasklist_lock = 0;
 	struct task_struct *p;
 
 	rcu_read_lock();
+	if (unlikely(sig_kernel_stop(sig) || sig == SIGCONT)) {
+		read_lock(&tasklist_lock);
+		acquired_tasklist_lock = 1;
+	}
 	p = find_task_by_pid(pid);
 	error = -ESRCH;
 	if (p)
 		error = group_send_sig_info(sig, info, p);
+	if (unlikely(acquired_tasklist_lock)) {
+		read_unlock(&tasklist_lock);
+	}
 	rcu_read_unlock();
 	return error;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix SIGSTOP locking issue in -rt
  2005-11-01 19:58 [PATCH] Fix SIGSTOP locking issue in -rt Paul E. McKenney
@ 2005-11-02 13:11 ` Ingo Molnar
  0 siblings, 0 replies; 2+ messages in thread
From: Ingo Molnar @ 2005-11-02 13:11 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: linux-kernel, akpm, oleg


* Paul E. McKenney <paulmck@us.ibm.com> wrote:

> Hello!
> 
> The following patch fixes a locking issue in -rt signals, where the 
> job-control signals drop sighand_lock momentarily during signal 
> handling. This interacts badly with the RCU-ification of unicast 
> signal delivery. The fix is simply to acquire tasklist_lock for 
> job-control signals, since these typically do not have stringent 
> scalability or latency requirements.

thanks, applied - will show up in -rt3.

	Ingo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-02 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-01 19:58 [PATCH] Fix SIGSTOP locking issue in -rt Paul E. McKenney
2005-11-02 13:11 ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox