public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>,
	[email protected], [email protected]
Subject: [PATCH v2 1/8] io_uring: leave a comment for drain_next
Date: Sat, 25 Jan 2020 22:53:38 +0300	[thread overview]
Message-ID: <fba3559e833b7d220cf6a12ecbf9ac3856154979.1579981749.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Draining the middle of a link is tricky, so leave a comment there

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index e79d6e47dc7b..bc1cab6a256a 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4702,6 +4702,13 @@ static bool io_submit_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe,
 	if (*link) {
 		struct io_kiocb *head = *link;
 
+		/*
+		 * Taking sequential execution of a link, draining both sides
+		 * of the link also fullfils IOSQE_IO_DRAIN semantics for all
+		 * requests in the link. So, it drains the head and the
+		 * next after the link request. The last one is done via
+		 * drain_next flag to persist the effect across calls.
+		 */
 		if (sqe_flags & IOSQE_IO_DRAIN) {
 			head->flags |= REQ_F_IO_DRAIN;
 			ctx->drain_next = 1;
-- 
2.24.0


  reply	other threads:[~2020-01-25 19:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 21:40 [PATCH 0/8] add persistent submission state Pavel Begunkov
2020-01-24 21:40 ` [PATCH 1/8] io_uring: add comment for drain_next Pavel Begunkov
2020-01-24 21:40 ` [PATCH 2/8] io_uring: always pass non-null io_submit_state Pavel Begunkov
2020-01-24 21:40 ` [PATCH 3/8] io_uring: place io_submit_state into ctx Pavel Begunkov
2020-01-24 21:40 ` [PATCH 4/8] io_uring: move ring_fd into io_submit_state Pavel Begunkov
2020-01-24 21:40 ` [PATCH 5/8] io_uring: move cur_mm " Pavel Begunkov
2020-01-24 21:40 ` [PATCH 6/8] io_uring: move *link " Pavel Begunkov
2020-01-24 21:40 ` [PATCH 7/8] io_uring: persistent req bulk allocation cache Pavel Begunkov
2020-01-24 21:40 ` [PATCH 8/8] io_uring: optimise " Pavel Begunkov
2020-01-25 19:53 ` [PATCH v2 0/8] add persistent submission state Pavel Begunkov
2020-01-25 19:53   ` Pavel Begunkov [this message]
2020-01-25 19:53   ` [PATCH v2 2/8] io_uring: always pass non-null io_submit_state Pavel Begunkov
2020-01-25 19:53   ` [PATCH v2 3/8] io_uring: place io_submit_state into ctx Pavel Begunkov
2020-01-25 19:53   ` [PATCH v2 4/8] io_uring: move ring_fd into io_submit_state Pavel Begunkov
2020-01-25 19:53   ` [PATCH v2 5/8] io_uring: move cur_mm " Pavel Begunkov
2020-01-25 19:53   ` [PATCH v2 6/8] io_uring: move *link " Pavel Begunkov
2020-01-25 19:53   ` [PATCH v2 7/8] io_uring: persistent req bulk allocation cache Pavel Begunkov
2020-01-25 19:53   ` [PATCH v2 8/8] io_uring: optimise " 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=fba3559e833b7d220cf6a12ecbf9ac3856154979.1579981749.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