Skip to content

Commit

Permalink
sched: fix rt ptracer monopolizing CPU
Browse files Browse the repository at this point in the history
yield() in wait_task_inactive(), can cause a high priority thread to be
scheduled back in, and there by loop forever while it is waiting for some
lower priority thread which is unfortunately still on the runqueue.

Use schedule_timeout_uninterruptible(1) instead.

Signed-off-by: Gautham R Shenoy <ego@in.ibm.com>
Credit: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Gautham R Shenoy authored and Ingo Molnar committed Oct 15, 2007
1 parent 5cb350b commit 638e13a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -1133,7 +1133,7 @@ void wait_task_inactive(struct task_struct *p)
* yield - it could be a while.
*/
if (unlikely(on_rq)) {
yield();
schedule_timeout_uninterruptible(1);
goto repeat;
}

Expand Down

0 comments on commit 638e13a

Please sign in to comment.