summaryrefslogtreecommitdiff
path: root/os
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2020-05-25 20:29:22 +0300
committerKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2020-05-31 13:45:47 +0300
commit7d42e66ec189ed87b247cef20797d84bf6ec4e0e (patch)
tree3b54d31a21af95be7b5b230316e1950c52e507f3 /os
parent2f6cbfdcf0ce3b53e83713e3a6b5a0bb6a76a1e9 (diff)
downloadfio-7d42e66ec189ed87b247cef20797d84bf6ec4e0e.tar.gz
fio-7d42e66ec189ed87b247cef20797d84bf6ec4e0e.tar.bz2
engines: pvsync2 libaio io_uring: add support for RWF_NOWAIT
Add bool option "nowait" into engines which could support this feature. Add test for libaio >= 0.3.111 into configure script to be compatible with prior versions where field iocb.aio_rw_flags was declared as "__pad2". By default if a request cannot be executed immediately (e.g. resource starvation, waiting on locks) it is queued and the initiating process will be blocked until the required resource becomes free. This option sets the RWF_NOWAIT flag (supported from the 4.14 Linux kernel) and the call will return instantly with EAGAIN or a partial result rather than waiting. It is useful to also use ignore_error=EAGAIN when using this option. Note: glibc 2.27, 2.28 have a bug in syscall wrappers preadv2, pwritev2. They return EOPNOTSUP instead of EAGAIN. For cached I/O, using this option usually means a request operates only with cached data. Currently the RWF_NOWAIT flag does not supported for cached write. For direct I/O, requests will only succeed if cache invalidation isn't required, file blocks are fully allocated and the disk request could be issued immediately. Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Link: https://lwn.net/Articles/724631/
Diffstat (limited to 'os')
-rw-r--r--os/os-linux.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/os/os-linux.h b/os/os-linux.h
index 0f0bcc3a..6ec7243d 100644
--- a/os/os-linux.h
+++ b/os/os-linux.h
@@ -325,6 +325,9 @@ static inline int fio_set_sched_idle(void)
#ifndef RWF_SYNC
#define RWF_SYNC 0x00000004
#endif
+#ifndef RWF_NOWAIT
+#define RWF_NOWAIT 0x00000008
+#endif
#ifndef RWF_UNCACHED
#define RWF_UNCACHED 0x00000040