From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH for-next 7/7] io_uring: add io_commit_cqring_flush()
Date: Sun, 19 Jun 2022 12:26:10 +0100 [thread overview]
Message-ID: <69cec30d9e4bfcf1a0c63e61ed6323cadc53d516.1655637157.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>
Since __io_commit_cqring_flush users moved to different files, introduce
io_commit_cqring_flush() helper and encapsulate all flags testing details
inside.
Signed-off-by: Pavel Begunkov <[email protected]>
---
io_uring/io_uring.c | 5 +----
io_uring/io_uring.h | 6 ++++++
io_uring/rw.c | 5 +----
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index cff046b0734b..c24c285dfac9 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -529,10 +529,7 @@ void __io_commit_cqring_flush(struct io_ring_ctx *ctx)
static inline void io_cqring_ev_posted(struct io_ring_ctx *ctx)
{
- if (unlikely(ctx->off_timeout_used || ctx->drain_active ||
- ctx->has_evfd))
- __io_commit_cqring_flush(ctx);
-
+ io_commit_cqring_flush(ctx);
io_cqring_wake(ctx);
}
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index bb8367908472..76cfb88af812 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -242,4 +242,10 @@ static inline void io_req_complete_defer(struct io_kiocb *req)
wq_list_add_tail(&req->comp_list, &state->compl_reqs);
}
+static inline void io_commit_cqring_flush(struct io_ring_ctx *ctx)
+{
+ if (unlikely(ctx->off_timeout_used || ctx->drain_active || ctx->has_evfd))
+ __io_commit_cqring_flush(ctx);
+}
+
#endif
diff --git a/io_uring/rw.c b/io_uring/rw.c
index 5f24db65a81d..17707e78ab01 100644
--- a/io_uring/rw.c
+++ b/io_uring/rw.c
@@ -948,10 +948,7 @@ int io_write(struct io_kiocb *req, unsigned int issue_flags)
static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx)
{
- if (unlikely(ctx->off_timeout_used || ctx->drain_active ||
- ctx->has_evfd))
- __io_commit_cqring_flush(ctx);
-
+ io_commit_cqring_flush(ctx);
if (ctx->flags & IORING_SETUP_SQPOLL)
io_cqring_wake(ctx);
}
--
2.36.1
next prev parent reply other threads:[~2022-06-19 11:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-19 11:26 [PATCH for-next 0/7] cqe posting cleanups Pavel Begunkov
2022-06-19 11:26 ` [PATCH for-next 1/7] io_uring: remove extra io_commit_cqring() Pavel Begunkov
2022-06-19 11:26 ` [PATCH for-next 2/7] io_uring: reshuffle io_uring/io_uring.h Pavel Begunkov
2022-06-19 11:26 ` [PATCH for-next 3/7] io_uring: move io_eventfd_signal() Pavel Begunkov
2022-06-19 11:26 ` [PATCH for-next 4/7] io_uring: hide eventfd assumptions in evenfd paths Pavel Begunkov
2022-06-19 18:18 ` Jens Axboe
2022-06-19 18:49 ` Pavel Begunkov
2022-06-19 18:58 ` Jens Axboe
2022-06-19 11:26 ` [PATCH for-next 5/7] io_uring: remove ->flush_cqes optimisation Pavel Begunkov
2022-06-19 13:31 ` Jens Axboe
2022-06-19 14:52 ` Pavel Begunkov
2022-06-19 15:52 ` Jens Axboe
2022-06-19 16:15 ` Pavel Begunkov
2022-06-19 16:17 ` Jens Axboe
2022-06-19 16:19 ` Pavel Begunkov
2022-06-19 16:38 ` Jens Axboe
2022-06-19 16:38 ` Jens Axboe
2022-06-19 11:26 ` [PATCH for-next 6/7] io_uring: introduce locking helpers for CQE posting Pavel Begunkov
2022-06-19 13:30 ` Jens Axboe
2022-06-19 14:20 ` Pavel Begunkov
2022-06-19 15:50 ` Jens Axboe
2022-06-19 11:26 ` Pavel Begunkov [this message]
2022-06-19 12:36 ` [PATCH for-next 0/7] cqe posting cleanups Pavel Begunkov
2022-06-19 16:01 ` 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=69cec30d9e4bfcf1a0c63e61ed6323cadc53d516.1655637157.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