From: Jens Axboe Date: Wed, 28 May 2008 08:35:42 +0000 (+0200) Subject: Merge branch 'master' of ssh://router/data/git/fio X-Git-Tag: fio-1.21-rc3~3 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=951417ad5aae0ff21493a1dff8b6d7ac63566403;hp=cb499fc4216eb4266c70ae238608f67def1758fe Merge branch 'master' of ssh://router/data/git/fio --- diff --git a/io_u.c b/io_u.c index c3939b32..b10e83ee 100644 --- a/io_u.c +++ b/io_u.c @@ -258,7 +258,6 @@ static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u) static void set_rwmix_bytes(struct thread_data *td) { - unsigned long issues; unsigned int diff; /* @@ -266,11 +265,8 @@ static void set_rwmix_bytes(struct thread_data *td) * buffered writes may issue a lot quicker than they complete, * whereas reads do not. */ - issues = td->io_issues[td->rwmix_ddir] - td->rwmix_issues; diff = td->o.rwmix[td->rwmix_ddir ^ 1]; - - td->rwmix_issues = td->io_issues[td->rwmix_ddir] - + (issues * ((100 - diff)) / diff); + td->rwmix_issues = (td->io_issues[td->rwmix_ddir] * diff) / 100; } static inline enum fio_ddir get_rand_ddir(struct thread_data *td) @@ -280,7 +276,7 @@ static inline enum fio_ddir get_rand_ddir(struct thread_data *td) r = os_random_long(&td->rwmix_state); v = 1 + (int) (100.0 * (r / (RAND_MAX + 1.0))); - if (v < td->o.rwmix[DDIR_READ]) + if (v <= td->o.rwmix[DDIR_READ]) return DDIR_READ; return DDIR_WRITE;