public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 06/10] io_uring: kill REQ_F_LINK_NEXT
Date: Sun, 28 Jun 2020 12:52:34 +0300	[thread overview]
Message-ID: <ac2d994fbd527f77a9fc75c96924460aee5a52fd.1593337097.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

After pulling nxt from a request, it's no more a link's head, so
clear REQ_F_LINK_HEAD. Absence of this flag also indicates that
there are no linked requests, so replacing REQ_F_LINK_NEXT,
which can be killed.

Linked timeouts also behave leaving the flag intact when necessary.

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

diff --git a/fs/io_uring.c b/fs/io_uring.c
index f64cca727021..b9f44c6b32f1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -526,7 +526,6 @@ enum {
 	REQ_F_BUFFER_SELECT_BIT	= IOSQE_BUFFER_SELECT_BIT,
 
 	REQ_F_LINK_HEAD_BIT,
-	REQ_F_LINK_NEXT_BIT,
 	REQ_F_FAIL_LINK_BIT,
 	REQ_F_INFLIGHT_BIT,
 	REQ_F_CUR_POS_BIT,
@@ -565,8 +564,6 @@ enum {
 
 	/* head of a link */
 	REQ_F_LINK_HEAD		= BIT(REQ_F_LINK_HEAD_BIT),
-	/* already grabbed next link */
-	REQ_F_LINK_NEXT		= BIT(REQ_F_LINK_NEXT_BIT),
 	/* fail rest of links */
 	REQ_F_FAIL_LINK		= BIT(REQ_F_FAIL_LINK_BIT),
 	/* on inflight list */
@@ -1559,10 +1556,6 @@ static void io_req_link_next(struct io_kiocb *req, struct io_kiocb **nxtptr)
 	struct io_ring_ctx *ctx = req->ctx;
 	bool wake_ev = false;
 
-	/* Already got next link */
-	if (req->flags & REQ_F_LINK_NEXT)
-		return;
-
 	/*
 	 * The list should never be empty when we are called here. But could
 	 * potentially happen if the chain is messed up, check to be on the
@@ -1587,7 +1580,6 @@ static void io_req_link_next(struct io_kiocb *req, struct io_kiocb **nxtptr)
 		break;
 	}
 
-	req->flags |= REQ_F_LINK_NEXT;
 	if (wake_ev)
 		io_cqring_ev_posted(ctx);
 }
@@ -1628,6 +1620,7 @@ static void io_req_find_next(struct io_kiocb *req, struct io_kiocb **nxt)
 {
 	if (likely(!(req->flags & REQ_F_LINK_HEAD)))
 		return;
+	req->flags &= ~REQ_F_LINK_HEAD;
 
 	/*
 	 * If LINK is set, we have dependent requests in this chain. If we
-- 
2.24.0


  parent reply	other threads:[~2020-06-28  9:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-28  9:52 [PATCH 00/10] some fixing + refactoring batch-free Pavel Begunkov
2020-06-28  9:52 ` [PATCH 01/10] io_uring: fix refs underflow in io_iopoll_queue() Pavel Begunkov
2020-06-28  9:52 ` [PATCH 02/10] io_uring: remove inflight batching in free_many() Pavel Begunkov
2020-06-28  9:52 ` [PATCH 03/10] io_uring: dismantle req early and remove need_iter Pavel Begunkov
2020-06-28  9:52 ` [PATCH 04/10] io_uring: batch-free linked reqs as well Pavel Begunkov
2020-06-28  9:52 ` [PATCH 05/10] io_uring: cosmetic changes for batch free Pavel Begunkov
2020-06-28  9:52 ` Pavel Begunkov [this message]
2020-06-28  9:52 ` [PATCH 07/10] io_uring: clean up req->result setting by rw Pavel Begunkov
2020-06-28  9:52 ` [PATCH 08/10] io_uring: fix missing wake_up io_rw_reissue() Pavel Begunkov
2020-06-28 14:12   ` Jens Axboe
2020-06-28 14:48     ` Pavel Begunkov
2020-06-28  9:52 ` [PATCH 09/10] io_uring: do task_work_run() during iopoll Pavel Begunkov
2020-06-28  9:52 ` [PATCH 10/10] io_uring: fix iopoll -EAGAIN handling Pavel Begunkov
2020-06-28 14:09 ` [PATCH 00/10] some fixing + refactoring batch-free 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=ac2d994fbd527f77a9fc75c96924460aee5a52fd.1593337097.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