From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 5/5] io_uring: avoid req->ctx reload in io_req_put_rsrc_nodes()
Date: Tue, 17 Mar 2026 14:35:18 -0600 [thread overview]
Message-ID: <20260317203622.1007183-6-axboe@kernel.dk> (raw)
In-Reply-To: <20260317203622.1007183-1-axboe@kernel.dk>
Cache 'ctx' to avoid it needing to get potentially reloaded.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
io_uring/io_uring.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index d703f0a8b315..6eaa21e09469 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1073,12 +1073,14 @@ void io_queue_next(struct io_kiocb *req)
static inline void io_req_put_rsrc_nodes(struct io_kiocb *req)
{
+ struct io_ring_ctx *ctx = req->ctx;
+
if (req->file_node) {
- io_put_rsrc_node(req->ctx, req->file_node);
+ io_put_rsrc_node(ctx, req->file_node);
req->file_node = NULL;
}
if (req->flags & REQ_F_BUF_NODE)
- io_put_rsrc_node(req->ctx, req->buf_node);
+ io_put_rsrc_node(ctx, req->buf_node);
}
static void io_free_batch_list(struct io_ring_ctx *ctx,
--
2.53.0
prev parent reply other threads:[~2026-03-17 20:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-17 20:35 [PATCHSET for-next 0/5] Various minor cleanups Jens Axboe
2026-03-17 20:35 ` [PATCH 1/5] io_uring/kbuf: use 'ctx' consistently Jens Axboe
2026-03-17 20:35 ` [PATCH 2/5] io_uring/poll: cache req->apoll_events Jens Axboe
2026-03-17 20:35 ` [PATCH 3/5] io_uring/net: use 'ctx' consistently Jens Axboe
2026-03-17 20:35 ` [PATCH 4/5] io_uring/rw: use cached file rather than req->file Jens Axboe
2026-03-17 20:35 ` Jens Axboe [this message]
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=20260317203622.1007183-6-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/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