From: Jens Axboe Date: Sat, 17 Nov 2012 17:06:36 +0000 (-0700) Subject: Use unique seed for zipf/pareto init if rand_repeat is not set X-Git-Tag: fio-2.0.12~50 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8425687edef1b2961a17bd58341686f7b598cf28 Use unique seed for zipf/pareto init if rand_repeat is not set By default, fio uses repeatable random sequences for anything. This makes it easy to run the same job again. But if this is disabled, ensure that the zipf/pareto sequences are also randomized. Re-use the normal random io offset seed for the random distribution too. Signed-off-by: Jens Axboe --- diff --git a/filesetup.c b/filesetup.c index 8636e166..c488eb47 100644 --- a/filesetup.c +++ b/filesetup.c @@ -873,6 +873,9 @@ static int __init_rand_distribution(struct thread_data *td, struct fio_file *f) nranges = (f->real_file_size + range_size - 1) / range_size; seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number; + if (!td->o.rand_repeatable) + seed = td->rand_seeds[4]; + if (td->o.random_distribution == FIO_RAND_DIST_ZIPF) zipf_init(&f->zipf, nranges, td->o.zipf_theta, seed); else