Commit 8465e792 authored by Ingo Molnar's avatar Ingo Molnar

sched: entity_key() fix

entity_key() fix - we'd occasionally end up with a 0 vruntime
in the !initial case.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
parent ddc97297
...@@ -479,13 +479,16 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) ...@@ -479,13 +479,16 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
if (initial && sched_feat(START_DEBIT)) if (initial && sched_feat(START_DEBIT))
vruntime += __sched_vslice(cfs_rq->nr_running + 1); vruntime += __sched_vslice(cfs_rq->nr_running + 1);
if (!initial && sched_feat(NEW_FAIR_SLEEPERS)) { if (!initial) {
s64 latency = cfs_rq->min_vruntime - se->last_min_vruntime; if (sched_feat(NEW_FAIR_SLEEPERS)) {
if (latency < 0 || !cfs_rq->nr_running) s64 latency = cfs_rq->min_vruntime - se->last_min_vruntime;
latency = 0; if (latency < 0 || !cfs_rq->nr_running)
else latency = 0;
latency = min_t(s64, latency, sysctl_sched_latency); else
vruntime -= latency; latency = min_t(s64, latency, sysctl_sched_latency);
vruntime -= latency;
}
vruntime = max(vruntime, se->vruntime);
} }
se->vruntime = vruntime; se->vruntime = vruntime;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment