Skip to content

Commit

Permalink
wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACE…
Browse files Browse the repository at this point in the history
…D task

Upstream commit 9067ac8.

wake_up_process() should never wakeup a TASK_STOPPED/TRACED task.
Change it to use TASK_NORMAL and add the WARN_ON().

TASK_ALL has no other users, probably can be killed.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
oleg-nesterov authored and gregkh committed Mar 3, 2013
1 parent a214998 commit 8a9279a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -2778,7 +2778,8 @@ static void try_to_wake_up_local(struct task_struct *p)
*/
int wake_up_process(struct task_struct *p)
{
return try_to_wake_up(p, TASK_ALL, 0);
WARN_ON(task_is_stopped_or_traced(p));
return try_to_wake_up(p, TASK_NORMAL, 0);
}
EXPORT_SYMBOL(wake_up_process);

Expand Down

0 comments on commit 8a9279a

Please sign in to comment.