X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=1560749618a5a91ed6152849cba8f9124b73dc16;hp=85a981dc4d3fdf05183661fd9b012522a60c2aed;hb=4b157ac6446364e5eecdcdbf75fc1a814489a343;hpb=e7b24047454305dd61c9b4f9f73628a03c240a9f;ds=sidebyside diff --git a/backend.c b/backend.c index 85a981dc..15607496 100644 --- a/backend.c +++ b/backend.c @@ -448,7 +448,7 @@ static int wait_for_completions(struct thread_data *td, struct timeval *time) * if the queue is full, we MUST reap at least 1 event */ min_evts = min(td->o.iodepth_batch_complete_min, td->cur_depth); - if ((full && !min_evts) || !td->o.iodepth_batch_complete_min) + if ((full && !min_evts) || !td->o.iodepth_batch_complete_min) min_evts = 1; if (time && (__should_check_rate(td, DDIR_READ) || @@ -782,10 +782,16 @@ 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_rate) { + if (td->o.rate_process == RATE_PROCESS_POISSON) { + uint64_t val; iops = bps / td->o.bs[ddir]; - td->last_usec += (int64_t) (1000000 / iops) * - -logf(__rand_0_1(&td->poisson_state)); + val = (int64_t) (1000000 / iops) * + -logf(__rand_0_1(&td->poisson_state)); + if (val) { + dprint(FD_RATE, "poisson rate iops=%llu\n", + (unsigned long long) 1000000 / val); + } + td->last_usec += val; return td->last_usec; } else if (bps) { secs = bytes / bps;