From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>,
[email protected], [email protected]
Subject: [PATCH v2 2/5] io_uring: remove REQ_F_MUST_PUNT
Date: Sun, 16 Feb 2020 01:01:19 +0300 [thread overview]
Message-ID: <f0d8ec082bc4cf7057c5ac071756d952be908217.1581785642.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
REQ_F_MUST_PUNT is needed to ignore REQ_F_NOWAIT and thus always punt
async if have got -EAGAIN. It's enough to clear REQ_F_NOWAIT instead of
having yet another flag.
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 7a132be72863..1dc83d887183 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -477,7 +477,6 @@ enum {
REQ_F_LINK_TIMEOUT_BIT,
REQ_F_TIMEOUT_BIT,
REQ_F_ISREG_BIT,
- REQ_F_MUST_PUNT_BIT,
REQ_F_TIMEOUT_NOSEQ_BIT,
REQ_F_COMP_LOCKED_BIT,
REQ_F_NEED_CLEANUP_BIT,
@@ -514,8 +513,6 @@ enum {
REQ_F_TIMEOUT = BIT(REQ_F_TIMEOUT_BIT),
/* regular file */
REQ_F_ISREG = BIT(REQ_F_ISREG_BIT),
- /* must be punted even for NONBLOCK */
- REQ_F_MUST_PUNT = BIT(REQ_F_MUST_PUNT_BIT),
/* no timeout sequence */
REQ_F_TIMEOUT_NOSEQ = BIT(REQ_F_TIMEOUT_NOSEQ_BIT),
/* completion under lock */
@@ -2252,11 +2249,11 @@ static int io_read(struct io_kiocb *req, struct io_kiocb **nxt,
req->result = io_size;
/*
- * If the file doesn't support async, mark it as REQ_F_MUST_PUNT so
- * we know to async punt it even if it was opened O_NONBLOCK
+ * If the file doesn't support async, async punt it even if it
+ * was opened O_NONBLOCK
*/
if (force_nonblock && !io_file_supports_async(req->file)) {
- req->flags |= REQ_F_MUST_PUNT;
+ req->flags &= ~REQ_F_NOWAIT;
goto copy_iov;
}
@@ -2341,11 +2338,11 @@ static int io_write(struct io_kiocb *req, struct io_kiocb **nxt,
req->result = io_size;
/*
- * If the file doesn't support async, mark it as REQ_F_MUST_PUNT so
- * we know to async punt it even if it was opened O_NONBLOCK
+ * If the file doesn't support async, async punt it even if it
+ * was opened O_NONBLOCK
*/
if (force_nonblock && !io_file_supports_async(req->file)) {
- req->flags |= REQ_F_MUST_PUNT;
+ req->flags &= ~REQ_F_NOWAIT;
goto copy_iov;
}
@@ -4725,8 +4722,7 @@ static void __io_queue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe)
* We async punt it if the file wasn't marked NOWAIT, or if the file
* doesn't support non-blocking read/write attempts
*/
- if (ret == -EAGAIN && (!(req->flags & REQ_F_NOWAIT) ||
- (req->flags & REQ_F_MUST_PUNT))) {
+ if (ret == -EAGAIN && !(req->flags & REQ_F_NOWAIT)) {
punt:
if (io_op_defs[req->opcode].file_table) {
ret = io_grab_files(req);
--
2.24.0
next prev parent reply other threads:[~2020-02-15 22:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-15 22:01 [PATCH v2 0/5] async punting improvements for io_uring Pavel Begunkov
2020-02-15 22:01 ` [PATCH v2 1/5] io_uring: add missing io_req_cancelled() Pavel Begunkov
2020-02-16 17:15 ` Jens Axboe
2020-02-16 19:09 ` Pavel Begunkov
2020-02-15 22:01 ` Pavel Begunkov [this message]
2020-02-15 22:01 ` [PATCH v2 3/5] io_uring: don't call work.func from sync ctx Pavel Begunkov
2020-02-15 22:01 ` [PATCH v2 4/5] io_uring: don't do full *prep_worker() from io-wq Pavel Begunkov
2020-02-15 22:01 ` [PATCH v2 5/5] io_uring: remove req->in_async Pavel Begunkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f0d8ec082bc4cf7057c5ac071756d952be908217.1581785642.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox