diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-09 12:42:41 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-09 15:36:54 +0100 |
commit | 62a1f544fcbb264b8b70d25ed9fb7395e109160a (patch) | |
tree | a9172c1dba2c46bc24d758636f580de587e267b6 /benchmarks | |
parent | 0d67d8ee678e883ba8a1e40699b73b7db2d540fe (diff) |
wsim: Per-client prng pool for miscellaneous randoms
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/gem_wsim.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/benchmarks/gem_wsim.c b/benchmarks/gem_wsim.c index 8023cd0e..2a8af7ba 100644 --- a/benchmarks/gem_wsim.c +++ b/benchmarks/gem_wsim.c @@ -105,6 +105,8 @@ struct workload unsigned int nr_steps; struct w_step *steps; + uint32_t prng; + struct timespec repeat_start; int pipe[2]; @@ -628,6 +630,8 @@ prepare_workload(unsigned int id, struct workload *wrk, unsigned int flags) struct w_step *w; int i; + wrk->prng = rand(); + if (flags & INITVCSRR) wrk->vcs_rr = id & 1; @@ -818,7 +822,7 @@ __rt_balance(const struct workload_balancer *balancer, else if (qd[VCS2] < qd[VCS1]) n = 1; else if (random) - n = hars_petruska_f54_1_random_unsafe() & 1; + n = hars_petruska_f54_1_random(&wrk->prng) & 1; else n = wrk->vcs_rr; @@ -845,7 +849,6 @@ static enum intel_engine_id rtr_balance(const struct workload_balancer *balancer, struct workload *wrk, struct w_step *w) { - return __rt_balance(balancer, wrk, w, true); } |