projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9966af7
)
engines/libaio: better protect against a busy loop in getevents()
author
Andrey Kuzmin
<andrey.v.kuzmin@gmail.com>
Fri, 10 Oct 2014 02:14:27 +0000
(20:14 -0600)
committer
Jens Axboe
<axboe@fb.com>
Fri, 10 Oct 2014 02:14:27 +0000
(20:14 -0600)
If we reap nothing and we were asked to reap > 0 events, then
reuse our commit, sleep, and retry loop.
Signed-off-by: Jens Axboe <axboe@fb.com>
engines/libaio.c
patch
|
blob
|
blame
|
history
diff --git
a/engines/libaio.c
b/engines/libaio.c
index 7c3a42a48fd99a4819ea020755c8c07a512ac5c7..12f3b366d71be5c521a67d238878f0f3a947ad2d 100644
(file)
--- a/
engines/libaio.c
+++ b/
engines/libaio.c
@@
-165,9
+165,9
@@
static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
r = io_getevents(ld->aio_ctx, actual_min,
max, ld->aio_events + events, lt);
}
- if (r >
=
0)
+ if (r > 0)
events += r;
- else if (r == -EAGAIN) {
+ else if (
(min && r == 0) ||
r == -EAGAIN) {
fio_libaio_commit(td);
usleep(100);
} else if (r != -EINTR)