From 1520f26e713a2fded6728ad372af0d7b8c197adf Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 16 Jul 2015 14:56:00 -0600 Subject: [PATCH] Re-seed random generator correctly between loops re-seeding random generator in this way means that random patterns will precisely repeat between iterations. if rand_repeatable is set, this is desirable, otherwise it may produce unexpected IO patterns in random IO testing. Signed-off-by: Jens Axboe --- libfio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libfio.c b/libfio.c index 3a28f55e..30a3acb5 100644 --- a/libfio.c +++ b/libfio.c @@ -116,9 +116,10 @@ void clear_io_state(struct thread_data *td) } /* - * Set the same seed to get repeatable runs + * Re-Seed random number generator if rand_repeatable is true */ - td_fill_rand_seeds(td); + if (td->o.rand_repeatable) + td_fill_rand_seeds(td); } void reset_all_stats(struct thread_data *td) -- 2.25.1