]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
sched: another wakeup_granularity fix
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Mon, 15 Oct 2007 15:00:14 +0000 (17:00 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 15 Oct 2007 15:00:14 +0000 (17:00 +0200)
unit mis-match: wakeup_gran was used against a vruntime

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c

index f5f491762e3510aff5e1624f84d2ac0b3ccfeb86..3ecbfd0902d88fc278f55d7c44e05388d1e88aa0 100644 (file)
@@ -818,7 +818,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
        struct task_struct *curr = rq->curr;
        struct cfs_rq *cfs_rq = task_cfs_rq(curr);
        struct sched_entity *se = &curr->se, *pse = &p->se;
-       s64 delta;
+       s64 delta, gran;
 
        if (unlikely(rt_prio(p->prio))) {
                update_rq_clock(rq);
@@ -833,8 +833,11 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p)
        }
 
        delta = se->vruntime - pse->vruntime;
+       gran = sysctl_sched_wakeup_granularity;
+       if (unlikely(se->load.weight != NICE_0_LOAD))
+               gran = calc_delta_fair(gran, &se->load);
 
-       if (delta > (s64)sysctl_sched_wakeup_granularity)
+       if (delta > gran)
                resched_task(curr);
 }