]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: mitigate unlikely iopoll lag
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 8 Jul 2021 12:37:06 +0000 (13:37 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Jul 2021 20:07:43 +0000 (14:07 -0600)
commit88a322938d39b309ae4e189aff8327b84e617dc6
treed5bbc637a1d26e833810b7c52bed9d353bf99fd6
parent63ae56f12f0dfc460e887e3e6e824d232158bf1a
io_uring: mitigate unlikely iopoll lag

We have requests like IORING_OP_FILES_UPDATE that don't go through
->iopoll_list but get completed in place under ->uring_lock, and so
after dropping the lock io_iopoll_check() should expect that some CQEs
might have get completed in a meanwhile.

Currently such events won't be accounted in @nr_events, and the loop
will continue to poll even if there is enough of CQEs. It shouldn't be a
problem as it's not likely to happen and so, but not nice either. Just
return earlier in this case, it should be enough.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/66ef932cc66a34e3771bbae04b2953a8058e9d05.1625747741.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c