aio: support for IO polling
authorJens Axboe <axboe@kernel.dk>
Sat, 17 Nov 2018 17:43:50 +0000 (10:43 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 19 Nov 2018 19:07:07 +0000 (12:07 -0700)
commit248a1e82895bf8f68bdf0a77ae7868fbb080d93a
tree52dd361b0212abd6ab79f6a72034bbe33c27b869
parente48959bce30d8b3d991f4918a4f3f07489f48699
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.

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.

It's illegal to mix polled and non-polled IO on the same ioctx.
This is because we need to know at io_getevents() time if we have
any non-polled IOs pending. For polled IO, we can never sleep in
the read_events() path, since polled IO may not trigger async
completions through an IRQ. In lieu of having some way of marking
an ioctx as strictly polled or non-polled, we track this state
and return -EINVAL if the application mixes the two types.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/aio.c
include/uapi/linux/aio_abi.h