OSDN Git Service

io_uring: don't burn CPU for iopoll on exit
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 7 Jul 2020 13:36:22 +0000 (16:36 +0300)
committerJens Axboe <axboe@kernel.dk>
Tue, 7 Jul 2020 18:00:03 +0000 (12:00 -0600)
commitb2edc0a77fac19bbdef63cedb2ea34aec1a9a499
tree31005a549f2c11fb048380fa94d84739ecb2fffc
parent7668b92a69b8201e2dd16a47a08efb93e909f419
io_uring: don't burn CPU for iopoll on exit

First of all don't spin in io_ring_ctx_wait_and_kill() on iopoll.
Requests won't complete faster because of that, but only lengthen
io_uring_release().

The same goes for offloaded cleanup in io_ring_exit_work() -- it
already has waiting loop, don't do blocking active spinning.

For that, pass min=0 into io_iopoll_[try_]reap_events(), so it won't
actively spin. Leave the function if io_do_iopoll() there can't
complete a request to sleep in io_ring_exit_work().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c