aboutsummaryrefslogtreecommitdiffstats
path: root/io_uring/poll.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-01-28 20:08:24 -0700
committerJens Axboe <axboe@kernel.dk>2024-02-08 13:27:06 -0700
commit95041b93e90a06bb613ec4bef9cd4d61570f68e4 (patch)
treea40378fc60c611affd5f48bfe2efa56c9c00e157 /io_uring/poll.c
parent521223d7c229f83915619f888c99e952f24dc39f (diff)
downloadlinux-95041b93e90a06bb613ec4bef9cd4d61570f68e4.tar.gz
io_uring: add io_file_can_poll() helper
This adds a flag to avoid dipping dereferencing file and then f_op to figure out if the file has a poll handler defined or not. We generally call this at least twice for networked workloads, and if using ring provided buffers, we do it on every buffer selection. Particularly the latter is troublesome, as it's otherwise a very fast operation. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/poll.c')
-rw-r--r--io_uring/poll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c
index c2b0a2d0762b2..3f3380dc5f681 100644
--- a/io_uring/poll.c
+++ b/io_uring/poll.c
@@ -724,7 +724,7 @@ int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags)
if (!def->pollin && !def->pollout)
return IO_APOLL_ABORTED;
- if (!file_can_poll(req->file))
+ if (!io_file_can_poll(req))
return IO_APOLL_ABORTED;
if (!(req->flags & REQ_F_APOLL_MULTISHOT))
mask |= EPOLLONESHOT;