summaryrefslogtreecommitdiff
path: root/configure
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 /configure
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 'configure')
-rwxr-xr-xconfigure20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure b/configure
index cf8b88e4..3ee8aaf2 100755
--- a/configure
+++ b/configure
@@ -617,8 +617,25 @@ EOF
libaio=no
libaio_uring=no
fi
+
+ cat > $TMPC <<EOF
+#include <libaio.h>
+#include <stddef.h>
+int main(void)
+{
+ io_prep_preadv2(NULL, 0, NULL, 0, 0, 0);
+ io_prep_pwritev2(NULL, 0, NULL, 0, 0, 0);
+ return 0;
+}
+EOF
+ if compile_prog "" "" "libaio rw flags" ; then
+ libaio_rw_flags=yes
+ else
+ libaio_rw_flags=no
+ fi
fi
print_config "Linux AIO support" "$libaio"
+print_config "Linux AIO support rw flags" "$libaio_rw_flags"
print_config "Linux AIO over io_uring" "$libaio_uring"
##########################################
@@ -2646,6 +2663,9 @@ if test "$zlib" = "yes" ; then
fi
if test "$libaio" = "yes" ; then
output_sym "CONFIG_LIBAIO"
+ if test "$libaio_rw_flags" = "yes" ; then
+ output_sym "CONFIG_LIBAIO_RW_FLAGS"
+ fi
if test "$libaio_uring" = "yes" ; then
output_sym "CONFIG_LIBAIO_URING"
fi