aio: support for IO polling
authorJens Axboe <axboe@kernel.dk>
Tue, 4 Dec 2018 17:12:45 +0000 (10:12 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 4 Dec 2018 17:12:45 +0000 (10:12 -0700)
commit9d60c04e9470fefd80dc0149d40628e311dcc267
tree956432acea3f9221f391fd2a3f5eec20b8bcae48
parent99c5bb2b9dffef1dec0b6f37d2fc4eca7c3dc195
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.

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