From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 8/8] io_uring: optimise io_req_find_next() fast check
Date: Tue, 30 Jun 2020 15:20:43 +0300 [thread overview]
Message-ID: <79bf871cc697106b6f914a2c64f957a1de06e5d3.1593519186.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
gcc 9.2.0 compiles io_req_find_next() as a separate function leaving
the first REQ_F_LINK_HEAD fast check not inlined. Help it by splitting
out the check from the function.
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 68dcc29c5dc5..8cac266b4674 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1643,12 +1643,9 @@ static void io_fail_links(struct io_kiocb *req)
io_cqring_ev_posted(ctx);
}
-static struct io_kiocb *io_req_find_next(struct io_kiocb *req)
+static struct io_kiocb *__io_req_find_next(struct io_kiocb *req)
{
- if (likely(!(req->flags & REQ_F_LINK_HEAD)))
- return NULL;
req->flags &= ~REQ_F_LINK_HEAD;
-
if (req->flags & REQ_F_LINK_TIMEOUT)
io_kill_linked_timeout(req);
@@ -1664,6 +1661,13 @@ static struct io_kiocb *io_req_find_next(struct io_kiocb *req)
return NULL;
}
+static struct io_kiocb *io_req_find_next(struct io_kiocb *req)
+{
+ if (likely(!(req->flags & REQ_F_LINK_HEAD)))
+ return NULL;
+ return __io_req_find_next(req);
+}
+
static void __io_req_task_cancel(struct io_kiocb *req, int error)
{
struct io_ring_ctx *ctx = req->ctx;
--
2.24.0
next prev parent reply other threads:[~2020-06-30 12:22 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 12:20 [PATCH 0/8] iopoll and task_work fixes Pavel Begunkov
2020-06-30 12:20 ` [PATCH 1/8] io_uring: fix io_fail_links() locking Pavel Begunkov
2020-06-30 14:38 ` Jens Axboe
2020-06-30 14:45 ` Pavel Begunkov
2020-06-30 12:20 ` [PATCH 2/8] io_uring: fix commit_cqring() locking in iopoll Pavel Begunkov
2020-06-30 14:04 ` Jens Axboe
2020-06-30 14:36 ` Pavel Begunkov
2020-06-30 14:46 ` Jens Axboe
2020-06-30 15:00 ` Pavel Begunkov
2020-06-30 15:33 ` Jens Axboe
2020-06-30 12:20 ` [PATCH 3/8] io_uring: fix ignoring eventfd " Pavel Begunkov
2020-06-30 12:20 ` [PATCH 4/8] io_uring: fix missing ->mm on exit Pavel Begunkov
2020-06-30 12:20 ` [PATCH 5/8] io_uring: don't fail iopoll requeue without ->mm Pavel Begunkov
2020-06-30 12:20 ` [PATCH 6/8] io_uring: fix NULL mm in io_poll_task_func() Pavel Begunkov
2020-06-30 12:20 ` [PATCH 7/8] io_uring: simplify io_async_task_func() Pavel Begunkov
2020-06-30 12:20 ` Pavel Begunkov [this message]
2020-06-30 12:39 ` [PATCH 0/8] iopoll and task_work fixes 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=79bf871cc697106b6f914a2c64f957a1de06e5d3.1593519186.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