Skip to content

Commit

Permalink
io_u: ensure we generate the full length of block sizes
Browse files Browse the repository at this point in the history
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 <axboe@kernel.dk>
  • Loading branch information
axboe committed Jul 10, 2018
1 parent 04bc85a commit 09ad10d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions io_u.c
Expand Up @@ -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;
Expand Down

0 comments on commit 09ad10d

Please sign in to comment.