sched/rt: Add reschedule check to switched_from_rt()
authorKirill Tkhai <tkhai@yandex.ru>
Thu, 22 Nov 2012 20:02:15 +0000 (00:02 +0400)
committerIngo Molnar <mingo@kernel.org>
Thu, 24 Jan 2013 16:14:30 +0000 (17:14 +0100)
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>
kernel/sched/rt.c

index 418feb01344edb7e59f11643e153e2f1866cc4ed..29bda5bdf2a57d14e0f2ca71830569cdd5313bfa 100644 (file)
@@ -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)