aio: support for IO polling
authorJens Axboe <axboe@kernel.dk>
Tue, 11 Dec 2018 23:27:17 +0000 (16:27 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 3 Jan 2019 15:14:02 +0000 (08:14 -0700)
commit457f72cbe3eb7ee67e6ac7f3f74e04459b2ea5b7
treef6f6fc5da54fae461d1c14bed63081a2d22e85b1
parent8a1e1717bb1d84488113267d69bb4203d2e300ae
aio: support for IO polling

Add polled variants of PREAD/PREADV and PWRITE/PWRITEV. These act
like their non-polled counterparts, except we expect to poll for
completion of them. The polling happens at io_getevent() time, and
works just like non-polled IO.

To setup an io_context for polled IO, the application must call
io_setup2() with IOCTX_FLAG_IOPOLL as one of the flags. It is illegal
to mix and match polled and non-polled IO on an io_context.

Polled IO doesn't support the user mapped completion ring. Events
must be reaped through the io_getevents() system call. For non-irq
driven poll devices, there's no way to support completion reaping
from userspace by just looking at the ring. The application itself
is the one that pulls completion entries.

Reviewed-by: Benny Halevy <bhalevy@scylladb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/aio.c
include/uapi/linux/aio_abi.h