X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=85a981dc4d3fdf05183661fd9b012522a60c2aed;hp=7a030ebbbe40e2f3a10347376d1dd26eb045479c;hb=e7b24047454305dd61c9b4f9f73628a03c240a9f;hpb=ff6bb260a1dbade1559f26892883690021aa4598 diff --git a/backend.c b/backend.c index 7a030ebb..85a981dc 100644 --- a/backend.c +++ b/backend.c @@ -782,17 +782,18 @@ static long long usec_for_io(struct thread_data *td, enum fio_ddir ddir) bytes = td->rate_io_issue_bytes[ddir]; bps = td->rate_bps[ddir]; - if (td->o.poisson_request) { + if (td->o.poisson_rate) { iops = bps / td->o.bs[ddir]; - td->last_usec += (long long)(1000000 / iops) * - (-logf(((float)rand() + 1) / ((float)RAND_MAX + 1))); + td->last_usec += (int64_t) (1000000 / iops) * + -logf(__rand_0_1(&td->poisson_state)); return td->last_usec; } else if (bps) { secs = bytes / bps; remainder = bytes % bps; return remainder * 1000000 / bps + secs * 1000000; - } else - return 0; + } + + return 0; } /*