Skip to content

Commit

Permalink
sched: fix startup penalty calculation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ingo Molnar committed Aug 24, 2007
1 parent ea0aa3b commit 095e56c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched_fair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 095e56c

Please sign in to comment.