From 182cab24328ab22a5b76ba1edac2c801b83aeffb Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 4 Jun 2018 13:51:47 -0600 Subject: [PATCH] Fix issue with rate_process=poisson and ramp time Fix from shimrot Fixes: https://github.com/axboe/fio/issues/596 Signed-off-by: Jens Axboe --- backend.c | 2 ++ libfio.c | 1 + 2 files changed, 3 insertions(+) diff --git a/backend.c b/backend.c index 033d5a70..180348f8 100644 --- 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; } } diff --git a/libfio.c b/libfio.c index 6faf32a4..674bc1dc 100644 --- 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; } } -- 2.25.1