]> git.karo-electronics.de Git - linux-beck.git/blobdiff - kernel/sched/rt.c
Merge remote-tracking branches 'asoc/topic/samsung' and 'asoc/topic/wm8750' into...
[linux-beck.git] / kernel / sched / rt.c
index d024e6ce30baf50037eac7c256dacc5bf27856f4..ee15f5a0d1c1896c1cc6edf2d202c3f1652c87f8 100644 (file)
@@ -1301,9 +1301,6 @@ select_task_rq_rt(struct task_struct *p, int cpu, int sd_flag, int flags)
        struct task_struct *curr;
        struct rq *rq;
 
-       if (p->nr_cpus_allowed == 1)
-               goto out;
-
        /* For anything but wake ups, just return the task_cpu */
        if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK)
                goto out;
@@ -1351,16 +1348,22 @@ out:
 
 static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
 {
-       if (rq->curr->nr_cpus_allowed == 1)
+       /*
+        * Current can't be migrated, useless to reschedule,
+        * let's hope p can move out.
+        */
+       if (rq->curr->nr_cpus_allowed == 1 ||
+           !cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
                return;
 
+       /*
+        * p is migratable, so let's not schedule it and
+        * see if it is pushed or pulled somewhere else.
+        */
        if (p->nr_cpus_allowed != 1
            && cpupri_find(&rq->rd->cpupri, p, NULL))
                return;
 
-       if (!cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
-               return;
-
        /*
         * There appears to be other cpus that can accept
         * current and none to run 'p', so lets reschedule
@@ -2128,6 +2131,8 @@ const struct sched_class rt_sched_class = {
 
        .prio_changed           = prio_changed_rt,
        .switched_to            = switched_to_rt,
+
+       .update_curr            = update_curr_rt,
 };
 
 #ifdef CONFIG_SCHED_DEBUG