From: Jens Axboe Date: Wed, 8 Oct 2014 02:03:14 +0000 (-0600) Subject: libaio: commit on EAGAIN X-Git-Tag: fio-2.1.14~88 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=0fc2e103bc78e99f96b88d5aa1f45e0ca704a049;hp=8e47b0ad5ba0f567c6ae4fabeb516bc1b4fcd651 libaio: commit on EAGAIN If we have pending IOs, commit them. Signed-off-by: Jens Axboe --- diff --git a/engines/libaio.c b/engines/libaio.c index d11a262e..7c3a42a4 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -13,6 +13,8 @@ #include "../fio.h" +static int fio_libaio_commit(struct thread_data *td); + struct libaio_data { io_context_t aio_ctx; struct io_event *aio_events; @@ -165,9 +167,10 @@ static int fio_libaio_getevents(struct thread_data *td, unsigned int min, } if (r >= 0) events += r; - else if (r == -EAGAIN) + else if (r == -EAGAIN) { + fio_libaio_commit(td); usleep(100); - else if (r != -EINTR) + } else if (r != -EINTR) break; } while (events < min);