io_uring: allow application controlled CQ ring size
authorJens Axboe <axboe@kernel.dk>
Fri, 4 Oct 2019 18:10:03 +0000 (12:10 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Oct 2019 16:22:46 +0000 (10:22 -0600)
commit33a107f0a1b8df0ad925e39d8afc97bb78e0cec1
tree7050b2355408fcc4fa9ab8753e195335a5126c5f
parentc3a31e605620c279163c14068a60869ea3fda203
io_uring: allow application controlled CQ ring size

We currently size the CQ ring as twice the SQ ring, to allow some
flexibility in not overflowing the CQ ring. This is done because the
SQE life time is different than that of the IO request itself, the SQE
is consumed as soon as the kernel has seen the entry.

Certain application don't need a huge SQ ring size, since they just
submit IO in batches. But they may have a lot of requests pending, and
hence need a big CQ ring to hold them all. By allowing the application
to control the CQ ring size multiplier, we can cater to those
applications more efficiently.

If an application wants to define its own CQ ring size, it must set
IORING_SETUP_CQSIZE in the setup flags, and fill out
io_uring_params->cq_entries. The value must be a power of two.

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