fio: document locking for overlap checking in offload mode
[fio.git] / rate-submit.c
index 68ad755d948056c0ff9fabc0a26a14961f410a05..e5c6204351db00304db32fa376837faa9c420cc9 100644 (file)
@@ -21,6 +21,14 @@ static void check_overlap(struct io_u *io_u)
                 * time to prevent two threads from thinking the coast
                 * is clear and then submitting IOs that overlap with
                 * each other
+                *
+                * If an overlap is found, release the lock and
+                * re-acquire it before checking again to give other
+                * threads a chance to make progress
+                *
+                * If an overlap is not found, release the lock when the
+                * io_u's IO_U_F_FLIGHT flag is set so that this io_u
+                * can be checked by other threads as they assess overlap
                 */
                pthread_mutex_lock(&overlap_check);
                for_each_td(td, i) {