Skip to content

Commit

Permalink
sched/rt: Add reschedule check to switched_from_rt()
Browse files Browse the repository at this point in the history
Reschedule rq->curr if the first RT task has just been
pulled to the rq.

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Tkhai Kirill <tkhai@yandex.ru>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/118761353614535@web28f.yandex.ru
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Kirill Tkhai authored and Ingo Molnar committed Jan 24, 2013
1 parent a59f4e0 commit 1158ddb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions kernel/sched/rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1889,8 +1889,11 @@ static void switched_from_rt(struct rq *rq, struct task_struct *p)
* we may need to handle the pulling of RT tasks
* now.
*/
if (p->on_rq && !rq->rt.rt_nr_running)
pull_rt_task(rq);
if (!p->on_rq || rq->rt.rt_nr_running)
return;

if (pull_rt_task(rq))
resched_task(rq->curr);
}

void init_sched_rt_class(void)
Expand Down

0 comments on commit 1158ddb

Please sign in to comment.