summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-07-01 15:02:06 -0600
committerJens Axboe <axboe@kernel.dk>2022-07-01 15:02:06 -0600
commitaa75fc9db6b98ad317911b35b4a968139a648bb8 (patch)
tree19a5d1594203731da6c0b842ea206bb5dbc9a62a /lib
parentc86418b6ce561941cd7741159ba7c4ba5ddf81dd (diff)
downloadfio-aa75fc9db6b98ad317911b35b4a968139a648bb8.tar.gz
fio-aa75fc9db6b98ad317911b35b4a968139a648bb8.tar.bz2
lib/rand: improve __fill_random_buf()
This won't be equivalent to what we have, but I _think_ the randomness is good enough for this purpose. This improves performance by about 30% for me, tested on both aarch64 and x86-64. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib')
-rw-r--r--lib/rand.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rand.c b/lib/rand.c
index 2243c2b4..1df1a7a0 100644
--- a/lib/rand.c
+++ b/lib/rand.c
@@ -103,8 +103,7 @@ void __fill_random_buf(void *buf, unsigned int len, uint64_t seed)
for (; b != e; ++b) {
*b = seed;
- seed *= GOLDEN_RATIO_PRIME;
- seed >>= 3;
+ seed *= GOLDEN_RATIO_64;
}
if (fio_unlikely(rest))