aio: add support for submission/completion rings
authorJens Axboe <axboe@kernel.dk>
Tue, 11 Dec 2018 23:40:53 +0000 (16:40 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 3 Jan 2019 15:14:03 +0000 (08:14 -0700)
commitc12b5656e7d53cf089715f3231d893d1d6e0bf1c
tree9a672f5b3f7e919a22f2a0468077ea44cac5be47
parent8a70e218b7d296cf646d875581857b6c29560607
aio: add support for submission/completion rings

The submission queue (SQ) and completion queue (CQ) rings are shared
between the application and the kernel. This eliminates the need to
copy data back and forth to submit and complete IO. We use the same
structures as the old aio interface. The SQ rings are indexes into a
struct iocb array, like we would submit through io_submit(), and the
CQ rings are struct io_event, like we would pass in (and copy back)
from io_getevents().

A new system call is added for this, io_ring_enter(). This system call
submits IO that is stored in the SQ ring, and/or completes IO and stores
the results in the CQ ring. Hence it's possible to both complete and
submit IO in a single system call.

For IRQ driven IO, an application only needs to enter the kernel for
completions if it wants to wait for them to occur.

Sample application: http://git.kernel.dk/cgit/fio/plain/t/aio-ring.c

Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/x86/entry/syscalls/syscall_64.tbl
fs/aio.c
include/linux/syscalls.h
include/uapi/linux/aio_abi.h
kernel/sys_ni.c