From 0fc2e103bc78e99f96b88d5aa1f45e0ca704a049 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 7 Oct 2014 20:03:14 -0600 Subject: [PATCH 1/1] libaio: commit on EAGAIN If we have pending IOs, commit them. Signed-off-by: Jens Axboe --- engines/libaio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); -- 2.25.1