]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: make CQ ring wakeups be more efficient
authorJens Axboe <axboe@kernel.dk>
Tue, 24 Sep 2019 19:47:15 +0000 (13:47 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 26 Sep 2019 09:55:40 +0000 (03:55 -0600)
commit7cf1562ebd7f24799742e8bddd38a0c22299c8eb
treef6b34adf621ac71e5c5257d92e9c6d5ab9b58c1f
parentc29c0ecd095cc408d6e991991e1b3c00ad085f71
io_uring: make CQ ring wakeups be more efficient

For batched IO, it's not uncommon for waiters to ask for more than 1
IO to complete before being woken up. This is a problem with
wait_event() since tasks will get woken for every IO that completes,
re-check condition, then go back to sleep. For batch counts on the
order of what you do for high IOPS, that can result in 10s of extra
wakeups for the waiting task.

Add a private wake function that checks for the wake up count criteria
being met before calling autoremove_wake_function(). Pavel reports that
one test case he has runs 40% faster with proper batching of wakeups.

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