]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/io_uring.c
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)
commitbda521624e75c665c407b3d9cece6e7a28178cd8
treef6b34adf621ac71e5c5257d92e9c6d5ab9b58c1f
parentdaa5de5415849b9a53056ec1e1e88fe4c5c9aa2b
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