sched: fix startup penalty calculation
authorIngo Molnar <mingo@elte.hu>
Fri, 24 Aug 2007 18:39:10 +0000 (20:39 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 24 Aug 2007 18:39:10 +0000 (20:39 +0200)
fix task startup penalty miscalculation: sysctl_sched_granularity is
unsigned int and wait_runtime is long so we first have to convert it
to long before turning it negative ...

Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c

index c078f1a..4d6b7e2 100644 (file)
@@ -1047,7 +1047,7 @@ static void task_new_fair(struct rq *rq, struct task_struct *p)
         * -granularity/2, so initialize the task with that:
         */
        if (sysctl_sched_features & SCHED_FEAT_START_DEBIT)
-               p->se.wait_runtime = -(sysctl_sched_granularity / 2);
+               p->se.wait_runtime = -((long)sysctl_sched_granularity / 2);
 
        __enqueue_entity(cfs_rq, se);
 }