Fix issue with rate_process=poisson and ramp time
authorJens Axboe <axboe@kernel.dk>
Mon, 4 Jun 2018 19:51:47 +0000 (13:51 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 4 Jun 2018 19:51:47 +0000 (13:51 -0600)
Fix from shimrot

Fixes: https://github.com/axboe/fio/issues/596
Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c
libfio.c

index 033d5a707f2a896f161eab84299e2b1bf6a23de0..180348f841267df45bb2c9d7852d3e70097545ba 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -892,6 +892,8 @@ static void handle_thinktime(struct thread_data *td, enum fio_ddir ddir)
                        over = (usperop - total) / usperop * -bs;
 
                td->rate_io_issue_bytes[ddir] += (missed - over);
+               /* adjust for rate_process=poisson */
+               td->last_usec[ddir] += total;
        }
 }
 
index 6faf32a4e918158cc19a7196a28098c93e7bb111..674bc1dc0a9ed37216bf86ae25acef05e33dd4f4 100644 (file)
--- a/libfio.c
+++ b/libfio.c
@@ -92,6 +92,7 @@ static void reset_io_counters(struct thread_data *td, int all)
                        td->bytes_done[ddir] = 0;
                        td->rate_io_issue_bytes[ddir] = 0;
                        td->rate_next_io_time[ddir] = 0;
+                       td->last_usec[ddir] = 0;
                }
        }