From: Jens Axboe Date: Sat, 17 Feb 2007 01:09:01 +0000 (+0100) Subject: [PATCH] Fix random seed for numjobs > 1 X-Git-Tag: fio-1.12~78 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2f073b09812255edca0f5854d36720418db88912;p=fio.git [PATCH] Fix random seed for numjobs > 1 If you had numjobs larger than 1, then each shared job would get the same random seed, resulting in the exact same io pattern. Multiply the seed with the thread number, that will still get repeatable patterns but only per-thread/process. Signed-off-by: Jens Axboe --- diff --git a/init.c b/init.c index 9e41d55a..1dec2bbd 100644 --- a/init.c +++ b/init.c @@ -845,7 +845,7 @@ int init_random_state(struct thread_data *td) return 0; if (td->rand_repeatable) - seeds[3] = FIO_RANDSEED; + seeds[3] = FIO_RANDSEED * td->thread_number; if (!td->norandommap) { for_each_file(td, f, i) {