]> git.baikalelectronics.ru Git - 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)
commit92e72ddc7063ba288b3c4ce39e52adcc34e7231c
treeffb179c2fcc64c8f1be555387094b79fb6b1c6fb
parent309d3c130ebfdc17f74872112e381d21b2f15259
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