diff options
author | Jens Axboe <axboe@kernel.dk> | 2024-01-29 04:08:24 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-02-08 21:27:06 +0100 |
commit | 95041b93e90a06bb613ec4bef9cd4d61570f68e4 (patch) | |
tree | a40378fc60c611affd5f48bfe2efa56c9c00e157 /io_uring/poll.c | |
parent | io_uring/cancel: don't default to setting req->work.cancel_seq (diff) | |
download | linux-95041b93e90a06bb613ec4bef9cd4d61570f68e4.tar.xz linux-95041b93e90a06bb613ec4bef9cd4d61570f68e4.zip |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c index c2b0a2d0762b..3f3380dc5f68 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; |