@@ -1482,6 +1482,22 @@ pick_next_task_rt(struct rq *rq, struct task_struct *prev)
put_prev_task(rq, prev);
+#ifdef CONFIG_SMP
+ /*
+ * If there's a running higher class task, check_preempt_curr()
+ * doesn't invoke check_preempt_equal_prio() for rt tasks, so
+ * we can do the similar thing here.
+ */
+ if (rq->rt.rt_nr_total > 1 &&
+ (prev->sched_class == &dl_sched_class ||
+ prev->sched_class == &stop_sched_class)) {
+ p = peek_next_task_rt(rq);
+ if (p->nr_cpus_allowed != 1 &&
+ cpupri_find(&rq->rd->cpupri, p, NULL))
+ requeue_task_rt(rq, p, 0);
+ }
+#endif
+
p = _pick_next_task_rt(rq);
/* The running task is never eligible for pushing */