X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=101024d10c24b4ec34c90693cd0244a4f2feb7a6;hp=2ec478c1ac206ebf4163a2e854fb77002dba2366;hb=3e260a46ea9a8de224c3d0a29a608da3440f284a;hpb=572cfb3f4d2cbf22291b395f2bb41facdc17ce86 diff --git a/backend.c b/backend.c index 2ec478c1..101024d1 100644 --- a/backend.c +++ b/backend.c @@ -649,6 +649,8 @@ static uint64_t do_io(struct thread_data *td) else td_set_runstate(td, TD_RUNNING); + lat_target_init(td); + while ((td->o.read_iolog_file && !flist_empty(&td->io_log_list)) || (!flist_empty(&td->trim_list)) || !io_bytes_exceeded(td) || td->o.time_based) { @@ -680,8 +682,11 @@ static uint64_t do_io(struct thread_data *td) break; io_u = get_io_u(td); - if (!io_u) + if (!io_u) { + if (td->o.latency_target) + goto reap; break; + } ddir = io_u->ddir; @@ -776,6 +781,7 @@ sync_done: * can get BUSY even without IO queued, if the system is * resource starved. */ +reap: full = queue_full(td) || (ret == FIO_Q_BUSY && td->cur_depth); if (full || !td->o.iodepth_batch_complete) { min_evts = min(td->o.iodepth_batch_complete, @@ -812,6 +818,8 @@ sync_done: break; } } + if (!in_ramp_time(td) && td->o.latency_target) + lat_target_check(td); if (td->o.thinktime) { unsigned long long b;