X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=io_u.c;h=7709df5fe55bf7fb6237d6b93476b2f09a2d3d3d;hb=78c1eda5486f586ca73e9cbe7e40b93fccdbd218;hp=51da223d3e02ab194c45a77e6249870d9d0a62d4;hpb=799441286648bdced4f42d3040f37fd2e35eaf1d;p=fio.git diff --git a/io_u.c b/io_u.c index 51da223d..7709df5f 100644 --- a/io_u.c +++ b/io_u.c @@ -249,7 +249,12 @@ static int get_next_seq_block(struct thread_data *td, struct fio_file *f, assert(ddir_rw(ddir)); if (f->last_pos < f->real_file_size) { - *b = (f->last_pos - f->file_offset) / td->o.min_bs[ddir]; + unsigned long long pos = f->last_pos - f->file_offset; + + if (pos) + pos += td->o.ddir_seq_add; + + *b = pos / td->o.min_bs[ddir]; return 0; } @@ -481,6 +486,16 @@ static enum fio_ddir rate_ddir(struct thread_data *td, enum fio_ddir ddir) } else usec = td->rate_pending_usleep[ddir]; + /* + * We are going to sleep, ensure that we flush anything pending as + * not to skew our latency numbers + */ + if (td->cur_depth) { + int fio_unused ret; + + ret = io_u_queued_complete(td, td->cur_depth, NULL); + } + fio_gettime(&t, NULL); usec_sleep(td, usec); usec = utime_since_now(&t);