]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
io_uring: optimise completion timeout flushing
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 14 Jun 2021 22:37:25 +0000 (23:37 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 15 Jun 2021 21:38:40 +0000 (15:38 -0600)
commitf18ee4cf0a277a0e3d043755046d5817d4ddd618
treeffb179c2fcc64c8f1be555387094b79fb6b1c6fb
parent15641e427070f05fad2e9d74d191146d6514d30f
io_uring: optimise completion timeout flushing

io_commit_cqring() might be very hot and we definitely don't want to
touch ->timeout_list there, because 1) it's shared with the submission
side so might lead to cache bouncing and 2) may need to load an extra
cache line, especially for IRQ completions.

We're interested in it at the completion side only when there are
offset-mode timeouts, which are not so popular. Replace
list_empty(->timeout_list) hot path check with a new one-way flag, which
is set when we prepare the first offset-mode timeout.

note: the flag sits in the same line as briefly used after ->rings

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