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

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 <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
oleg-nesterov authored and torvalds committed Jan 22, 2013
1 parent 9899d11 commit 9067ac8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/sched/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,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 9067ac8

Please sign in to comment.