OSDN Git Service

io_uring: optimize submit_and_wait API
authorJens Axboe <axboe@kernel.dk>
Mon, 9 Sep 2019 22:19:45 +0000 (16:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Sep 2019 14:21:03 +0000 (08:21 -0600)
commitc576666863b788c2d7e8ab4ef4edd0e9059cb47b
treec32decec36832a25c82d8430ef80bd3c2375d437
parent4fe2c963154c31227bec2f2d690e01f9cab383ea
io_uring: optimize submit_and_wait API

For some applications that end up using a submit-and-wait type of
approach for certain batches of IO, we can make that a bit more
efficient by allowing the application to block for the last IO
submission. This prevents an async when we don't need it, as the
application will be blocking for the completion event(s) anyway.

Typical use cases are using the liburing
io_uring_submit_and_wait() API, or just using io_uring_enter()
doing both submissions and completions. As a specific example,
RocksDB doing MultiGet() is sped up quite a bit with this
change.

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