]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: use poll driven retry for files that support it
authorJens Axboe <axboe@kernel.dk>
Sat, 15 Feb 2020 05:23:12 +0000 (22:23 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 2 Mar 2020 21:06:38 +0000 (14:06 -0700)
commit91136458a716f714b4ce3d12d2d69e4e3df610d7
tree5a88525b8c6c5b2cc76d84e472a06f9317d39c5f
parentcb287960ab129479825f2112a79a9bb6bb768eb6
io_uring: use poll driven retry for files that support it

Currently io_uring tries any request in a non-blocking manner, if it can,
and then retries from a worker thread if we get -EAGAIN. Now that we have
a new and fancy poll based retry backend, use that to retry requests if
the file supports it.

This means that, for example, an IORING_OP_RECVMSG on a socket no longer
requires an async thread to complete the IO. If we get -EAGAIN reading
from the socket in a non-blocking manner, we arm a poll handler for
notification on when the socket becomes readable. When it does, the
pending read is executed directly by the task again, through the io_uring
task work handlers. Not only is this faster and more efficient, it also
means we're not generating potentially tons of async threads that just
sit and block, waiting for the IO to complete.

The feature is marked with IORING_FEAT_FAST_POLL, meaning that async
pollable IO is fast, and that poll<link>other_op is fast as well.

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