[PATCH 02/13] Use GOLDEN_RATIO_PRIME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Tomohiro Kusumi <tkusumi@xxxxxxxxxx>

Using this macro (originally for hash in Linux kernel) for rand seed
instead of hard-coded value should make sense. rdma ioengine uses
this for the seed as well.

Signed-off-by: Tomohiro Kusumi <tkusumi@xxxxxxxxxx>
---
 init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/init.c b/init.c
index 6af6c45..eef5150 100644
--- a/init.c
+++ b/init.c
@@ -26,6 +26,7 @@
 #include "idletime.h"
 #include "filelock.h"
 #include "steadystate.h"
+#include "hash.h"
 
 #include "oslib/getopt.h"
 #include "oslib/strcasestr.h"
@@ -1083,11 +1084,11 @@ static int setup_random_seeds(struct thread_data *td)
 
 	seed = td->o.rand_seed;
 	for (i = 0; i < 4; i++)
-		seed *= 0x9e370001UL;
+		seed *= GOLDEN_RATIO_PRIME;
 
 	for (i = 0; i < FIO_RAND_NR_OFFS; i++) {
 		td->rand_seeds[i] = seed * td->thread_number + i;
-		seed *= 0x9e370001UL;
+		seed *= GOLDEN_RATIO_PRIME;
 	}
 
 	td_fill_rand_seeds(td);
-- 
2.9.3

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux