[PATCH 1/3] finish_utrace_stop: use __fatal_signal_pending(), dont take ->siglock

Oleg Nesterov oleg at redhat.com
Fri Aug 14 12:20:58 UTC 2009


finish_utrace_stop() can check for pending SIGKILL lockless,
ant it can use __fatal_signal_pending() helper.

Signed-off-by: Oleg Nesterov <oleg at redhat.com>
---

 kernel/utrace.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

--- __UTRACE/kernel/utrace.c~1_FINISH_FATAL_SIGNAL	2009-08-14 11:58:05.000000000 +0200
+++ __UTRACE/kernel/utrace.c	2009-08-14 12:43:44.000000000 +0200
@@ -354,17 +354,15 @@ static inline bool finish_utrace_stop(st
 	 * We're officially awake if it's clear.
 	 */
 	if (unlikely(utrace->stopped)) {
-		spin_lock(&utrace->lock);
 		/*
 		 * If we're here with it still set, it must have been
 		 * signal_wake_up() instead, waking us up for a SIGKILL.
 		 */
-		spin_lock_irq(&task->sighand->siglock);
-		WARN_ON(!sigismember(&task->pending.signal, SIGKILL));
-		spin_unlock_irq(&task->sighand->siglock);
+		WARN_ON(!__fatal_signal_pending(task));
+		spin_lock(&utrace->lock);
 		utrace->stopped = 0;
-		killed = true;
 		spin_unlock(&utrace->lock);
+		killed = true;
 	}
 
 	return killed;




More information about the utrace-devel mailing list