]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: skip futile iopoll iterations
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 13 Apr 2021 01:58:45 +0000 (02:58 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 Apr 2021 15:37:55 +0000 (09:37 -0600)
commitc0192a5bbbeff8796d7e4249b9b6ba2416a7a463
treeab3eab8f8f49fcc2e9ddaf937c33015acb95b11e
parent6de99b4df096ec5a9284c7f01e66466356b2eb4a
io_uring: skip futile iopoll iterations

The only way to get out of io_iopoll_getevents() and continue iterating
is to have empty iopoll_list, otherwise the main loop would just exit.
So, instead of the unlock on 8th time heuristic, do that based on
iopoll_list.

Also, as no one can add new requests to iopoll_list while
io_iopoll_check() hold uring_lock, it's useless to spin with the list
empty, return in that case.

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