Fix thread hang when using async engines (libaio,etc.) when too low of a iops rate is specified.

Rate limiting logic was using thread_data->cur_depth to decide the
min_evts number to ask for during its "flush" prior to sleeping.
td->cur_depth, however, does not properly track in-flight IOs submitted
to the async engines.  Added field to thread_data structure and use
that, instead, to track IOs currently in flight.

Signed-off-by: Ryan Marchand <rmarchan@amazon.com>
Signed-off-by: Steven Noonan <snoonan@amazon.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diff --git a/fio.h b/fio.h
index a9286b8..c8b94f6 100644
--- a/fio.h
+++ b/fio.h
@@ -347,10 +347,23 @@
 	struct ioengine_ops *io_ops;
 
 	/*
-	 * Current IO depth and list of free and busy io_u's.
+	 * Queue depth of io_u's that fio MIGHT do
 	 */
 	unsigned int cur_depth;
+
+	/*
+	 * io_u's about to be committed
+	 */
 	unsigned int io_u_queued;
+
+	/*
+	 * io_u's submitted but not completed yet
+	 */
+	unsigned int io_u_in_flight;
+
+	/*
+	 * List of free and busy io_u's
+	 */
 	struct flist_head io_u_freelist;
 	struct flist_head io_u_busylist;
 	struct flist_head io_u_requeues;