diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-09-21 10:59:48 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-10-29 22:43:26 +0300 |
commit | 3c90b80df5b574c2c61626fd40fa3b23be21fa26 (patch) | |
tree | af07935a351b12b8ba73249df454d78e4f4d99f8 | |
parent | 165126dc5e23979721122dc5c7cfb28b1ca234cc (diff) | |
download | linux-3c90b80df5b574c2c61626fd40fa3b23be21fa26.tar.xz |
io_uring/eventfd: check for the need to async notifier earlier
It's not necessary to do this post grabbing a reference. With that, we
can drop the out goto path as well.
Link: https://lore.kernel.org/r/20240921080307.185186-3-axboe@kernel.dk
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | io_uring/eventfd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/io_uring/eventfd.c b/io_uring/eventfd.c index 8b628ab6bbff..829873806f9f 100644 --- a/io_uring/eventfd.c +++ b/io_uring/eventfd.c @@ -69,10 +69,10 @@ void io_eventfd_signal(struct io_ring_ctx *ctx) */ if (unlikely(!ev_fd)) return; + if (ev_fd->eventfd_async && !io_wq_current_is_worker()) + return; if (!refcount_inc_not_zero(&ev_fd->refs)) return; - if (ev_fd->eventfd_async && !io_wq_current_is_worker()) - goto out; if (likely(eventfd_signal_allowed())) { eventfd_signal_mask(ev_fd->cq_ev_fd, EPOLL_URING_WAKE); @@ -82,7 +82,6 @@ void io_eventfd_signal(struct io_ring_ctx *ctx) return; } } -out: io_eventfd_put(ev_fd); } |