From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 3/4] io_uring: optimise commit_sqring() for common case
Date: Mon, 30 Dec 2019 21:24:46 +0300 [thread overview]
Message-ID: <5f61617ff3347304948d46c5257cc52581f527fe.1577729827.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
It should be pretty rare to not submitting anything when there is
something in the ring. No need to keep heuristics for this case.
Signed-off-by: Pavel Begunkov <[email protected]>
---
fs/io_uring.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 05d07974a5b3..642aca3f2d1f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4506,14 +4506,12 @@ static void io_commit_sqring(struct io_ring_ctx *ctx)
{
struct io_rings *rings = ctx->rings;
- if (ctx->cached_sq_head != READ_ONCE(rings->sq.head)) {
- /*
- * Ensure any loads from the SQEs are done at this point,
- * since once we write the new head, the application could
- * write new data to them.
- */
- smp_store_release(&rings->sq.head, ctx->cached_sq_head);
- }
+ /*
+ * Ensure any loads from the SQEs are done at this point,
+ * since once we write the new head, the application could
+ * write new data to them.
+ */
+ smp_store_release(&rings->sq.head, ctx->cached_sq_head);
}
/*
--
2.24.0
next prev parent reply other threads:[~2019-12-30 18:25 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-30 18:24 [PATCH 0/4] a bunch of changes for submmission path Pavel Begunkov
2019-12-30 18:24 ` [PATCH 1/4] io_uring: clamp to_submit in io_submit_sqes() Pavel Begunkov
2019-12-30 18:24 ` [PATCH 2/4] io_uring: optimise head checks in io_get_sqring() Pavel Begunkov
2019-12-30 18:24 ` Pavel Begunkov [this message]
2019-12-30 18:24 ` [PATCH 4/4] io_uring: remove extra io_wq_current_is_worker() Pavel Begunkov
2019-12-30 22:24 ` [PATCH 0/4] a bunch of changes for submmission path 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=5f61617ff3347304948d46c5257cc52581f527fe.1577729827.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