[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/2] utrace_wakeup: do not check target->state



utrace_wakeup() is called when utrace->stopped = T. This means the task
is either TASK_TRACED or killed. If it is killed, SIGNAL_STOP_STOPPED
is not possible and wake_up_state(__TASK_TRACED) does nothing.

No need to check task_is_stopped_or_traced().

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

 kernel/utrace.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

--- __UTRACE/kernel/utrace.c~7_WAKEUP_DONT_CK_STATE	2009-09-09 01:29:02.000000000 +0200
+++ __UTRACE/kernel/utrace.c	2009-09-09 01:32:03.000000000 +0200
@@ -659,14 +659,13 @@ static void utrace_wakeup(struct task_st
 {
 	utrace->stopped = 0;
 
+	/* The task must be either TASK_TRACED or killed */
 	spin_lock_irq(&target->sighand->siglock);
-	if (likely(task_is_stopped_or_traced(target))) {
-		if (target->signal->flags & SIGNAL_STOP_STOPPED ||
-		    target->signal->group_stop_count)
-			target->state = TASK_STOPPED;
-		else
-			wake_up_state(target, __TASK_STOPPED | __TASK_TRACED);
-	}
+	if (target->signal->flags & SIGNAL_STOP_STOPPED ||
+	    target->signal->group_stop_count)
+		target->state = TASK_STOPPED;
+	else
+		wake_up_state(target, __TASK_TRACED);
 	spin_unlock_irq(&target->sighand->siglock);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]