sched/rt: Do not try to push tasks if pinned task switches to RT
authorKirill V Tkhai <tkhai@yandex.ru>
Wed, 12 Mar 2014 10:18:33 +0000 (06:18 -0400)
committerIngo Molnar <mingo@kernel.org>
Fri, 18 Apr 2014 10:07:23 +0000 (12:07 +0200)
Just switched pinned task is not able to be pushed. If the rq had had
several RT tasks before they have already been considered as candidates
to be pushed (or pulled).

Signed-off-by: Kirill V Tkhai <tkhai@yandex.ru>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20140312061833.3a43aa64@gandalf.local.home
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/rt.c

index bd2267ad404fa78de092b8bc8f228cfea2dca87b..1e4992eb5166fe0fb6f28ce9eb80dbadb829fd8e 100644 (file)
@@ -1892,9 +1892,9 @@ static void switched_to_rt(struct rq *rq, struct task_struct *p)
         */
        if (p->on_rq && rq->curr != p) {
 #ifdef CONFIG_SMP
-               if (rq->rt.overloaded && push_rt_task(rq) &&
+               if (p->nr_cpus_allowed > 1 && rq->rt.overloaded &&
                    /* Don't resched if we changed runqueues */
-                   rq != task_rq(p))
+                   push_rt_task(rq) && rq != task_rq(p))
                        check_resched = 0;
 #endif /* CONFIG_SMP */
                if (check_resched && p->prio < rq->curr->prio)