mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
ddc9729750
commit
8465e792e8
1 changed files with 10 additions and 7 deletions
|
@ -479,13 +479,16 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
|
|||
if (initial && sched_feat(START_DEBIT))
|
||||
vruntime += __sched_vslice(cfs_rq->nr_running + 1);
|
||||
|
||||
if (!initial && sched_feat(NEW_FAIR_SLEEPERS)) {
|
||||
s64 latency = cfs_rq->min_vruntime - se->last_min_vruntime;
|
||||
if (latency < 0 || !cfs_rq->nr_running)
|
||||
latency = 0;
|
||||
else
|
||||
latency = min_t(s64, latency, sysctl_sched_latency);
|
||||
vruntime -= latency;
|
||||
if (!initial) {
|
||||
if (sched_feat(NEW_FAIR_SLEEPERS)) {
|
||||
s64 latency = cfs_rq->min_vruntime - se->last_min_vruntime;
|
||||
if (latency < 0 || !cfs_rq->nr_running)
|
||||
latency = 0;
|
||||
else
|
||||
latency = min_t(s64, latency, sysctl_sched_latency);
|
||||
vruntime -= latency;
|
||||
}
|
||||
vruntime = max(vruntime, se->vruntime);
|
||||
}
|
||||
|
||||
se->vruntime = vruntime;
|
||||
|
|
Loading…
Add table
Reference in a new issue