From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 1/3] io_uring: arm poll for non-nowait files
Date: Sun, 17 Oct 2021 00:07:08 +0100 [thread overview]
Message-ID: <9d06f3cb2c8b686d970269a87986f154edb83043.1634425438.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Don't check if we can do nowait before arming apoll, there are several
reasons for that. First, we don't care much about files that don't
support nowait. Second, it may be useful -- we don't want to be taking
away extra workers from io-wq when it can go in some async. Even if it
will go through io-wq eventually, it make difference in the numbers of
workers actually used. And the last one, it's needed to clean nowait in
future commits.
[kernel test robot: fix unused-var]
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index ce9a1b89da3f..14566d1bf174 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5591,7 +5591,6 @@ static int io_arm_poll_handler(struct io_kiocb *req)
struct async_poll *apoll;
struct io_poll_table ipt;
__poll_t ret, mask = EPOLLONESHOT | POLLERR | POLLPRI;
- int rw;
if (!req->file || !file_can_poll(req->file))
return IO_APOLL_ABORTED;
@@ -5601,7 +5600,6 @@ static int io_arm_poll_handler(struct io_kiocb *req)
return IO_APOLL_ABORTED;
if (def->pollin) {
- rw = READ;
mask |= POLLIN | POLLRDNORM;
/* If reading from MSG_ERRQUEUE using recvmsg, ignore POLLIN */
@@ -5609,14 +5607,9 @@ static int io_arm_poll_handler(struct io_kiocb *req)
(req->sr_msg.msg_flags & MSG_ERRQUEUE))
mask &= ~POLLIN;
} else {
- rw = WRITE;
mask |= POLLOUT | POLLWRNORM;
}
- /* if we can't nonblock try, then no point in arming a poll handler */
- if (!io_file_supports_nowait(req, rw))
- return IO_APOLL_ABORTED;
-
apoll = kmalloc(sizeof(*apoll), GFP_ATOMIC);
if (unlikely(!apoll))
return IO_APOLL_ABORTED;
--
2.33.0
next prev parent reply other threads:[~2021-10-16 23:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-16 23:07 [PATCH 0/3] rw optimisation partial resend Pavel Begunkov
2021-10-16 23:07 ` Pavel Begunkov [this message]
2021-10-16 23:07 ` [PATCH 2/3] io_uring: combine REQ_F_NOWAIT_{READ,WRITE} flags Pavel Begunkov
2021-10-16 23:07 ` [PATCH 3/3] io_uring: simplify io_file_supports_nowait() Pavel Begunkov
2021-10-16 23:11 ` [PATCH 0/3] rw optimisation partial resend Pavel Begunkov
2021-10-16 23:17 ` Pavel Begunkov
2021-10-17 14:25 ` Jens Axboe
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=9d06f3cb2c8b686d970269a87986f154edb83043.1634425438.git.asml.silence@gmail.com \
[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