From: Andrey Kuzmin Date: Mon, 7 Mar 2016 21:40:25 +0000 (-0700) Subject: io_u: speed up __get_next_buflen() X-Git-Tag: fio-2.7~6 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=1ec4db15283551fc135b40dbd8abc07d4f67743e io_u: speed up __get_next_buflen() Change the divide-by-100 into a multiplier instead. Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index 0a398869..3299f290 100644 --- a/io_u.c +++ b/io_u.c @@ -553,7 +553,7 @@ static unsigned int __get_next_buflen(struct thread_data *td, struct io_u *io_u, buflen = bsp->bs; perc += bsp->perc; - if ((r <= ((frand_max / 100L) * perc)) && + if ((r * 100UL <= frand_max * perc) && io_u_fits(td, io_u, buflen)) break; }