Skip to content
Snippets Groups Projects
Commit c3c798da authored by Robert Love's avatar Robert Love Committed by Brian Swetland
Browse files

sched: fix weight calculations


Backport of 46151122:

The conversion between virtual and real time is as follows:

  dvt = rw/w * dt <=> dt = w/rw * dvt

Since we want the fair sleeper granularity to be in real time, we actually
need to do:

dvt = - rw/w * l

This bug could be related to the regression reported by Yanmin Zhang:

| Comparing with kernel 2.6.25, sysbench+mysql(oltp, readonly) has lots
| of regressions with 2.6.26-rc1:
|
| 1) 8-core stoakley: 28%;
| 2) 16-core tigerton: 20%;
| 3) Itanium Montvale: 50%.

Reported-by: default avatar"Zhang, Yanmin" <yanmin_zhang@linux.intel.com>
Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent ab696643
No related merge requests found
......@@ -511,11 +511,14 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
if (!initial) {
/* sleeps upto a single latency don't count. */
if (sched_feat(NEW_FAIR_SLEEPERS)) {
unsigned long thresh = sysctl_sched_latency;
/*
* convert the sleeper threshold into virtual time
*/
if (sched_feat(NORMALIZED_SLEEPER))
vruntime -= calc_delta_fair(sysctl_sched_latency,
&cfs_rq->load);
else
vruntime -= sysctl_sched_latency;
thresh = calc_delta_fair(thresh, &cfs_rq->load);
vruntime -= thresh;
}
/* ensure we never gain time by being placed backwards. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment