Skip to contentSkip to conversation

wait_task_stopped/continued: remove unneeded p->signal != NULL check

PATCH In review Oleg Nesterov 2 participants 2 messages Aug 28, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wait_task_stopped/continued: remove unneeded p->signal != NULL check

The child was found on ->children list under tasklist_lock, it must have a valid ->signal. __exit_signal() both removes the task from parent->children and clears ->signal "atomically" under write_lock(tasklist).

Remove unneeded checks.

kernel/exit.c renamed from kernel/exit.c~ +1 -4
@@ -1348,7 +1348,7 @@ static int wait_task_stopped(struct task
 	if (!p->exit_code)
 		return 0;
 	if (delayed_group_leader && !(p->ptrace & PT_PTRACED) &&
-	    p->signal && p->signal->group_stop_count > 0)
+	    p->signal->group_stop_count > 0)
 		/*
 		 * A group stop is in progress and this is the group leader.
 		 * We won't report until all threads have stopped.
@@ -1462,9 +1462,6 @@ static int wait_task_continued(struct ta
 	pid_t pid;
 	uid_t uid;
 
-	if (unlikely(!p->signal))
-		return 0;
-
 	if (!(p->signal->flags & SIGNAL_STOP_CONTINUED))
 		return 0;