瀏覽代碼

sched: fix rt ptracer monopolizing CPU

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>
Gautham R Shenoy 18 年之前
父節點
當前提交
638e13ac37
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      kernel/sched.c

+ 1 - 1
kernel/sched.c

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