OSDN Git Service

io_uring: fold evfd signalling under a slower path
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 17 Mar 2022 02:03:42 +0000 (02:03 +0000)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Mar 2022 02:26:32 +0000 (20:26 -0600)
commit9aa8dfde4869ccdec0a7290b686dbc10e079e163
tree4c3b1da830f66232ee6158524794be2090be531a
parent9333f6b4628c8037a89ed23e1188d4b7dc5d74e4
io_uring: fold evfd signalling under a slower path

Add ->has_evfd flag, which is true IFF there is an eventfd attached, and
use it to hide io_eventfd_signal() into __io_commit_cqring_flush() and
combine fast checks in a single if. Also, gcc 11.2 wasn't inlining
io_cqring_ev_posted() without this change, so helps with that as well.

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