engines: pvsync2 libaio io_uring: add support for RWF_NOWAIT
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Mon, 25 May 2020 17:29:22 +0000 (20:29 +0300)
committerKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
Sun, 31 May 2020 10:45:47 +0000 (13:45 +0300)
commit7d42e66ec189ed87b247cef20797d84bf6ec4e0e
tree3b54d31a21af95be7b5b230316e1950c52e507f3
parent2f6cbfdcf0ce3b53e83713e3a6b5a0bb6a76a1e9
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/
HOWTO
configure
engines/io_uring.c
engines/libaio.c
engines/sync.c
fio.1
os/os-linux.h