Thread (51 messages) 51 messages, 6 authors, 2025-02-27

Re: [PATCHv5 06/11] io_uring/rw: move fixed buffer import to issue path

From: Pavel Begunkov <asml.silence@gmail.com>
Date: 2025-02-25 13:56:07
Also in: io-uring

On 2/24/25 21:31, Keith Busch wrote:
quoted hunk ↗ jump to hunk
From: Keith Busch <kbusch@kernel.org>

Registered buffers may depend on a linked command, which makes the prep
path too early to import. Move to the issue path when the node is
actually needed like all the other users of fixed buffers.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
  io_uring/opdef.c |  8 ++++----
  io_uring/rw.c    | 43 ++++++++++++++++++++++++++-----------------
  io_uring/rw.h    |  4 ++--
  3 files changed, 32 insertions(+), 23 deletions(-)
diff --git a/io_uring/opdef.c b/io_uring/opdef.c
index 9344534780a02..5369ae33b5ad9 100644
--- a/io_uring/opdef.c
+++ b/io_uring/opdef.c
@@ -104,8 +104,8 @@ const struct io_issue_def io_issue_defs[] = {
  		.iopoll			= 1,
  		.iopoll_queue		= 1,
  		.async_size		= sizeof(struct io_async_rw),
-		.prep			= io_prep_read_fixed,
-		.issue			= io_read,
+		.prep			= io_prep_read,
io_prep_read_fixed() -> io_init_rw_fixed() -> io_prep_rw(do_import=false)
after:
io_prep_read() -> io_prep_rw(do_import=true)

This change flips do_import. I'd say, let's just remove the importing
bits from io_prep_rw_fixed(), and should be good for now.

Apart from that:

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>

-- 
Pavel Begunkov
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help