sched: fix rt ptracer monopolizing CPU
authorGautham R Shenoy <[email protected]>
Mon, 15 Oct 2007 15:00:14 +0000 (17:00 +0200)
committerIngo Molnar <[email protected]>
Mon, 15 Oct 2007 15:00:14 +0000 (17:00 +0200)
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 <[email protected]>
Credit: Oleg Nesterov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
kernel/sched.c

index 9ac99896db8f13094e253c36e62bfde20a481708..48fc74b6df55aba7195d5bfe25f7b4bf8b2bf531 100644 (file)
@@ -1133,7 +1133,7 @@ repeat:
         * yield - it could be a while.
         */
        if (unlikely(on_rq)) {
-               yield();
+               schedule_timeout_uninterruptible(1);
                goto repeat;
        }