io_uring/uring_cmd: implement ->sqe_copy() to avoid unnecessary copies uring_cmd.2
authorJens Axboe <axboe@kernel.dk>
Thu, 5 Jun 2025 17:39:17 +0000 (11:39 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 10 Jun 2025 13:36:26 +0000 (07:36 -0600)
commitbb6cf6aa346511fab526c60d977d8e71b63516b8
tree0d9dc56e47505a6f9eeac55cf5353d233bf249f7
parentcc213dbb6a58276bb69251c1226ce07531025506
io_uring/uring_cmd: implement ->sqe_copy() to avoid unnecessary copies

uring_cmd currently copies the full SQE at prep time, just in case it
needs it to be stable. However, for inline completions or requests that
get queued up on the device side, there's no need to ever copy the SQE.
This is particularly important, as various use cases of uring_cmd will
be using 128b sized SQEs.

Opt in to using ->sqe_copy() to let the core of io_uring decide when to
copy SQEs. This callback will only be called if it is safe to do so.

Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/opdef.c
io_uring/uring_cmd.c
io_uring/uring_cmd.h