engines/libaio: don't sleep for 0 reap return for 0 event check
authorJens Axboe <axboe@kernel.dk>
Tue, 24 Apr 2018 14:00:23 +0000 (08:00 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 24 Apr 2018 14:00:23 +0000 (08:00 -0600)
If we have set iodepth_batch_complete_min to 0, then we should
not sleep for completion checking. If we do sleep, reduce the
sleep to 10usec, 100usec is a lot on modern devices.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/libaio.c

index f46b3314581ce008ed8ca6befcd2a754cdfd7732..dae2a70b2c86ea8f8368d97bb680eaccf8d73862 100644 (file)
@@ -169,7 +169,8 @@ static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
                        events += r;
                else if ((min && r == 0) || r == -EAGAIN) {
                        fio_libaio_commit(td);
                        events += r;
                else if ((min && r == 0) || r == -EAGAIN) {
                        fio_libaio_commit(td);
-                       usleep(100);
+                       if (actual_min)
+                               usleep(10);
                } else if (r != -EINTR)
                        break;
        } while (events < min);
                } else if (r != -EINTR)
                        break;
        } while (events < min);