]> 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)
commitff3a1167ff4753893fe2414efdae1857fb3bdf6a
treeffb179c2fcc64c8f1be555387094b79fb6b1c6fb
parenteb78a2aed3658d5f2be54b4655f4ff870eb4c67c
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