diff options
author | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:11 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2007-10-15 11:00:11 -0400 |
commit | 8465e792e82c567b80358e38732164b770ed4b7f (patch) | |
tree | f03ba121f3feb3bdd3e88d09775091f17b539476 /kernel/sched_fair.c | |
parent | ddc972975091ba5f839bf24d0f9ef54fe90ee741 (diff) |
sched: entity_key() fix
entity_key() fix - we'd occasionally end up with a 0 vruntime
in the !initial case.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r-- | kernel/sched_fair.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index 8ea4c9b3e411..926491f7f803 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c | |||
@@ -479,13 +479,16 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) | |||
479 | if (initial && sched_feat(START_DEBIT)) | 479 | if (initial && sched_feat(START_DEBIT)) |
480 | vruntime += __sched_vslice(cfs_rq->nr_running + 1); | 480 | vruntime += __sched_vslice(cfs_rq->nr_running + 1); |
481 | 481 | ||
482 | if (!initial && sched_feat(NEW_FAIR_SLEEPERS)) { | 482 | if (!initial) { |
483 | s64 latency = cfs_rq->min_vruntime - se->last_min_vruntime; | 483 | if (sched_feat(NEW_FAIR_SLEEPERS)) { |
484 | if (latency < 0 || !cfs_rq->nr_running) | 484 | s64 latency = cfs_rq->min_vruntime - se->last_min_vruntime; |
485 | latency = 0; | 485 | if (latency < 0 || !cfs_rq->nr_running) |
486 | else | 486 | latency = 0; |
487 | latency = min_t(s64, latency, sysctl_sched_latency); | 487 | else |
488 | vruntime -= latency; | 488 | latency = min_t(s64, latency, sysctl_sched_latency); |
489 | vruntime -= latency; | ||
490 | } | ||
491 | vruntime = max(vruntime, se->vruntime); | ||
489 | } | 492 | } |
490 | 493 | ||
491 | se->vruntime = vruntime; | 494 | se->vruntime = vruntime; |