From: Jens Axboe Date: Tue, 10 Jul 2018 21:10:17 +0000 (-0600) Subject: io_u: ensure we generate the full length of block sizes X-Git-Tag: fio-3.8~19 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=09ad10d26facf5ca026589996ba2719b640df35a io_u: ensure we generate the full length of block sizes Since we round down, we can miss the last entry. This ensures that if we do: bsrange=4k-16k we actually get an even split of 4,8,12,16k ios. Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index 9e9dad5a..5221a78c 100644 --- a/io_u.c +++ b/io_u.c @@ -541,10 +541,8 @@ static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u, r = __rand(&td->bsrange_state[ddir]); if (!td->o.bssplit_nr[ddir]) { - buflen = 1 + (unsigned int) ((double) maxbs * + buflen = minbs + (unsigned int) ((double) maxbs * (r / (frand_max + 1.0))); - if (buflen < minbs) - buflen = minbs; } else { long long perc = 0; unsigned int i;