X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=4c609f2b88ae4c537dc90489241808acd711fa1f;hp=e8ed871d2d96d641014cbd79e7e4df27c6b472a3;hb=0209e1e5a24979172596cd1e249b32eaba78969f;hpb=de890a1e48d40238dac69f302708dde8719de240 diff --git a/ioengines.c b/ioengines.c index e8ed871d..4c609f2b 100644 --- a/ioengines.c +++ b/ioengines.c @@ -222,9 +222,14 @@ int td_io_getevents(struct thread_data *td, unsigned int min, unsigned int max, if (max && td->io_ops->getevents) r = td->io_ops->getevents(td, min, max, t); out: - if (r >= 0) + if (r >= 0) { + /* + * Reflect that our submitted requests were retrieved with + * whatever OS async calls are in the underlying engine. + */ + td->io_u_in_flight -= r; io_u_mark_complete(td, r); - else + } else td_verror(td, r, "get_events"); dprint(FD_IO, "getevents: %d\n", r); @@ -344,14 +349,19 @@ int td_io_commit(struct thread_data *td) if (!td->cur_depth || !td->io_u_queued) return 0; - io_u_mark_depth(td, td->io_u_queued); - td->io_u_queued = 0; + io_u_mark_depth(td, td->io_u_queued); if (td->io_ops->commit) { ret = td->io_ops->commit(td); if (ret) td_verror(td, -ret, "io commit"); } + + /* + * Reflect that events were submitted as async IO requests. + */ + td->io_u_in_flight += td->io_u_queued; + td->io_u_queued = 0; return 0; }