summaryrefslogtreecommitdiff
path: root/benchmarks/gem_wsim.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-05-09 12:43:13 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2017-05-09 15:42:21 +0100
commit6e6ad40c61ae0a6526f726195549a1c9b62c533c (patch)
tree2e148b0d53e9175c017a186b3d142828e86cd787 /benchmarks/gem_wsim.c
parent474bcddd6d4505e2131c1f8969289a9d4fb6a6db (diff)
wsim: Improve rt balancer to use history across sync points
Include the next batch in our estimated run time (that is the time to execute the remaining queued requests plus ours). This is a better estimate of queue length and also provides a bit of history to guide judgement after a sync point. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks/gem_wsim.c')
-rw-r--r--benchmarks/gem_wsim.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index 12be82e3..47b070e2 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -800,12 +800,12 @@ __rt_balance(const struct workload_balancer *balancer,
/* Estimate the "speed" of the most recent batch
* (finish time - submit time)
* and use that as an approximate for the total remaining time for
- * all batches on that engine. We try to keep the total remaining
- * balanced between the engines.
+ * all batches on that engine, plus the time we expect this batch to
+ * take. We try to keep the total balanced between the engines.
*/
qd[VCS1] = balancer->get_qd(balancer, wrk, VCS1);
wrk->qd_sum[VCS1] += qd[VCS1];
- qd[VCS1] *= wrk->status_page[2] - wrk->status_page[1];
+ qd[VCS1] = (qd[VCS1] + 1) * (wrk->status_page[2] - wrk->status_page[1]);
#ifdef DEBUG
printf("qd[0] = %d (%d - %d) x %d (%d - %d) = %ld\n",
wrk->seqno[VCS1] - wrk->status_page[0],
@@ -817,7 +817,7 @@ __rt_balance(const struct workload_balancer *balancer,
qd[VCS2] = balancer->get_qd(balancer, wrk, VCS2);
wrk->qd_sum[VCS2] += qd[VCS2];
- qd[VCS2] *= wrk->status_page[2 + 16] - wrk->status_page[1 + 16];
+ qd[VCS2] = (qd[VCS2] + 1) * (wrk->status_page[2 + 16] - wrk->status_page[1 + 16]);
#ifdef DEBUG
printf("qd[1] = %d (%d - %d) x %d (%d - %d) = %ld\n",
wrk->seqno[VCS2] - wrk->status_page[16],