sched: Leave sched_setscheduler() earlier if possible, do not disturb SCHED_FIFO...
[pandora-kernel.git] / kernel / sched.c
index f592ce6..a884551 100644 (file)
@@ -5011,6 +5011,17 @@ recheck:
                return -EINVAL;
        }
 
+       /*
+        * If not changing anything there's no need to proceed further:
+        */
+       if (unlikely(policy == p->policy && (!rt_policy(policy) ||
+                       param->sched_priority == p->rt_priority))) {
+
+               __task_rq_unlock(rq);
+               raw_spin_unlock_irqrestore(&p->pi_lock, flags);
+               return 0;
+       }
+
 #ifdef CONFIG_RT_GROUP_SCHED
        if (user) {
                /*