Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
[sfrench/cifs-2.6.git] / kernel / sched_fair.c
index 36b5e34fa99ecf7aa4dcb9b7bdaabbf938beebb9..56c0efe902a79bca1c578aa7fcd5e7d5f0df3144 100644 (file)
@@ -492,6 +492,8 @@ static void update_curr(struct cfs_rq *cfs_rq)
         * overflow on 32 bits):
         */
        delta_exec = (unsigned long)(now - curr->exec_start);
+       if (!delta_exec)
+               return;
 
        __update_curr(cfs_rq, curr, delta_exec);
        curr->exec_start = now;
@@ -1361,12 +1363,11 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync)
 {
        struct task_struct *curr = rq->curr;
        struct sched_entity *se = &curr->se, *pse = &p->se;
+       struct cfs_rq *cfs_rq = task_cfs_rq(curr);
 
-       if (unlikely(rt_prio(p->prio))) {
-               struct cfs_rq *cfs_rq = task_cfs_rq(curr);
+       update_curr(cfs_rq);
 
-               update_rq_clock(rq);
-               update_curr(cfs_rq);
+       if (unlikely(rt_prio(p->prio))) {
                resched_task(curr);
                return;
        }