Commit 8dd0de8b authored by Hillf Danton's avatar Hillf Danton Committed by Ingo Molnar
Browse files

sched: Fix need_resched() when checking peempt

The RT preempt check tests the wrong task if NEED_RESCHED is
set. It currently checks the local CPU task. It is supposed to
check the task that is running on the runqueue we are about to
wake another task on.
Signed-off-by: default avatarHillf Danton <>
Reviewed-by: default avatarYong Zhang <>
Signed-off-by: default avatarSteven Rostedt <>

Signed-off-by: default avatarIngo Molnar <>
parent 2c53b436
......@@ -1096,7 +1096,7 @@ static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p, int flag
* to move current somewhere else, making room for our non-migratable
* task.
if (p->prio == rq->curr->prio && !need_resched())
if (p->prio == rq->curr->prio && !test_tsk_need_resched(rq->curr))
check_preempt_equal_prio(rq, p);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment