projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
658d0a4
)
io_uring: don't try io-wq polling if not supported
author
Pavel Begunkov
<asml.silence@gmail.com>
Sat, 23 Oct 2021 11:13:59 +0000
(12:13 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 25 Oct 2021 13:42:33 +0000
(07:42 -0600)
If an opcode doesn't support polling, just let it be executed
synchronously in iowq, otherwise it will do a nonblock attempt just to
fail in io_arm_poll_handler() and return back to blocking execution.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/6401256db01b88f448f15fcd241439cb76f5b940.1634987320.git.asml.silence@gmail.com
Reviewed-by: Hao Xu <haoxu@linux.alibaba.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index bff911f951ed5d638e91d68d5a0ee25a1f9fe1db..c6f32fcf387b401d31f69e2e23472a848619ddc4 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-6741,9
+6741,13
@@
static void io_wq_submit_work(struct io_wq_work *work)
}
if (req->flags & REQ_F_FORCE_ASYNC) {
- needs_poll = req->file && file_can_poll(req->file);
- if (needs_poll)
+ const struct io_op_def *def = &io_op_defs[req->opcode];
+ bool opcode_poll = def->pollin || def->pollout;
+
+ if (opcode_poll && file_can_poll(req->file)) {
+ needs_poll = true;
issue_flags |= IO_URING_F_NONBLOCK;
+ }
}
do {