io_uring: try to register ring fd

Try to issue IORING_REGISTER_RING_FDS in io_uring queue initialization
to register the io_uring's own file descriptor. Use the registered ring
fd with IORING_ENTER_REGISTERED_RING for all io_uring_enter() syscalls.
This improves performance by avoiding the io_uring file descriptor
reference-counting overhead on each io_uring_enter() syscall.
IORING_REGISTER_RING_FDS isn't supported on older kernels, so fall back
to the existing behavior of passing io_uring_enter() a raw fd if the
registration fails.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
1 file changed