summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-01-28 20:08:24 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-19 15:28:44 +0200
commit90e11232a62bbd85e18c579c4b6b24030aa23d63 (patch)
treef9125d46445b471958cb59ed0fc676cef1eafc6b /io_uring/io_uring.c
parent4fa7831cf0ac71a0a345369d1a6084f2b096e55e (diff)
downloadlinux-90e11232a62bbd85e18c579c4b6b24030aa23d63.tar.gz
linux-90e11232a62bbd85e18c579c4b6b24030aa23d63.tar.bz2
linux-90e11232a62bbd85e18c579c4b6b24030aa23d63.zip
io_uring: add io_file_can_poll() helper
Commit 95041b93e90a06bb613ec4bef9cd4d61570f68e4 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r--io_uring/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 43b46098279a..9c383afeaf8e 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1953,7 +1953,7 @@ fail:
if (req->flags & REQ_F_FORCE_ASYNC) {
bool opcode_poll = def->pollin || def->pollout;
- if (opcode_poll && file_can_poll(req->file)) {
+ if (opcode_poll && io_file_can_poll(req)) {
needs_poll = true;
issue_flags |= IO_URING_F_NONBLOCK;
}