public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH for-next 5/5] io_uring: refactor __io_req_complete_post
Date: Mon, 16 Jan 2023 16:49:01 +0000	[thread overview]
Message-ID: <2b4fbb42f404a0e75c4d9f0a5b16f314a839d0a9.1673887636.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Keep parts of __io_req_complete_post() relying on req->flags together so
the value can be cached.

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

diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index e690c884dc95..27d9abd24a83 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -974,14 +974,14 @@ static void __io_req_complete_post(struct io_kiocb *req)
 				req->link = NULL;
 			}
 		}
+		io_put_kbuf_comp(req);
+		io_dismantle_req(req);
 		io_req_put_rsrc(req);
 		/*
 		 * Selected buffer deallocation in io_clean_op() assumes that
 		 * we don't hold ->completion_lock. Clean them here to avoid
 		 * deadlocks.
 		 */
-		io_put_kbuf_comp(req);
-		io_dismantle_req(req);
 		io_put_task(req->task, 1);
 		wq_list_add_head(&req->comp_list, &ctx->locked_free_list);
 		ctx->locked_free_nr++;
-- 
2.38.1


  parent reply	other threads:[~2023-01-16 17:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16 16:48 [PATCH for-next 0/5] random for-next patches Pavel Begunkov
2023-01-16 16:48 ` [PATCH for-next 1/5] io_uring: return back links tw run optimisation Pavel Begunkov
2023-01-16 18:43   ` Jens Axboe
2023-01-16 19:47     ` Pavel Begunkov
2023-01-16 21:04       ` Jens Axboe
2023-01-16 21:14         ` Pavel Begunkov
2023-01-16 21:17           ` Jens Axboe
2023-01-16 21:15         ` Pavel Begunkov
2023-01-16 21:18           ` Jens Axboe
2023-01-16 16:48 ` [PATCH for-next 2/5] io_uring: don't export io_put_task() Pavel Begunkov
2023-01-16 16:48 ` [PATCH for-next 3/5] io_uring: simplify fallback execution Pavel Begunkov
2023-01-16 16:49 ` [PATCH for-next 4/5] io_uring: optimise ctx flags layout Pavel Begunkov
2023-01-16 16:49 ` Pavel Begunkov [this message]
2023-01-16 21:09 ` [PATCH for-next 0/5] random for-next patches 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=2b4fbb42f404a0e75c4d9f0a5b16f314a839d0a9.1673887636.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