[v2] benchmarks/gem_wsim: Perturb static_vcs selection across clients

Submitted by Chris Wilson on May 14, 2019, 10:59 a.m.

Details

Message ID 20190514105958.7944-1-chris@chris-wilson.co.uk
State New
Headers show
Series "benchmarks/gem_wsim: Perturb static_vcs selection across clients" ( rev: 1 ) in IGT (deprecated)

Not browsing as part of any series.

Commit Message

Chris Wilson May 14, 2019, 10:59 a.m.
Use the client id to alternate the static_vcs balancer (-b context)
across clients with the round robin flag (-R) - otherwise all clients
end up on vcs0 and do not match the context balancing employed by
media-driver.

v2: Put it behind the -R flag.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 benchmarks/gem_wsim.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c
index afb9644dd..48568ce40 100644
--- a/benchmarks/gem_wsim.c
+++ b/benchmarks/gem_wsim.c
@@ -939,7 +939,7 @@  alloc_step_batch(struct workload *wrk, struct w_step *w, unsigned int flags)
 static void
 prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags)
 {
-	unsigned int ctx_vcs = 0;
+	unsigned int ctx_vcs;
 	int max_ctx = -1;
 	struct w_step *w;
 	int i;
@@ -948,8 +948,10 @@  prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags)
 	wrk->prng = rand();
 	wrk->run = true;
 
+	ctx_vcs =  0;
 	if (flags & INITVCSRR)
-		wrk->vcs_rr = id & 1;
+		ctx_vcs = id & 1;
+	wrk->vcs_rr = ctx_vcs;
 
 	if (flags & GLOBAL_BALANCE) {
 		int ret = pthread_mutex_init(&wrk->mutex, NULL);