From: Caleb Sander Mateos <csander@purestorage.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCH 1/4] io_uring: add IO_URING_F_INLINE issue flag
Date: Fri, 6 Jun 2025 10:31:58 -0700 [thread overview]
Message-ID: <CADUfDZpeHidaeQ482gFt8n2gPVXYY0aZKvch6Di=NbZxZm28_A@mail.gmail.com> (raw)
In-Reply-To: <20250605194728.145287-2-axboe@kernel.dk>
On Thu, Jun 5, 2025 at 12:47 PM Jens Axboe <axboe@kernel.dk> wrote:
>
> Set when the execution of the request is done inline from the system
> call itself. Any deferred issue will never have this flag set.
>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
> include/linux/io_uring_types.h | 2 ++
> io_uring/io_uring.c | 3 ++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
> index 2922635986f5..054c43c02c96 100644
> --- a/include/linux/io_uring_types.h
> +++ b/include/linux/io_uring_types.h
> @@ -26,6 +26,8 @@ enum io_uring_cmd_flags {
> IO_URING_F_MULTISHOT = 4,
> /* executed by io-wq */
> IO_URING_F_IOWQ = 8,
> + /* executed inline from syscall */
> + IO_URING_F_INLINE = 16,
> /* int's last bit, sign checks are usually faster than a bit test */
> IO_URING_F_NONBLOCK = INT_MIN,
>
> diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
> index cf759c172083..079a95e1bd82 100644
> --- a/io_uring/io_uring.c
> +++ b/io_uring/io_uring.c
> @@ -1962,7 +1962,8 @@ static inline void io_queue_sqe(struct io_kiocb *req)
> {
> int ret;
>
> - ret = io_issue_sqe(req, IO_URING_F_NONBLOCK|IO_URING_F_COMPLETE_DEFER);
> + ret = io_issue_sqe(req, IO_URING_F_NONBLOCK|IO_URING_F_COMPLETE_DEFER|
> + IO_URING_F_INLINE);
Isn't io_queue_sqe() also called from io_req_task_submit(), which is
an io_req_tw_func_t callback? Task work runs after the SQ slots have
already been returned to userspace, right? Before the unconditional
memcpy() was added, we had observed requests in linked chains with
corrupted SQEs due to the async task work issue.
As is, it looks like IO_URING_F_INLINE is just the inverse of
IO_URING_F_IOWQ, so it may not be necessary to add a new flag. But I
can see how core io_uring might add additional async issue cases in
the future.
Best,
Caleb
>
> /*
> * We async punt it if the file wasn't marked NOWAIT, or if the file
> --
> 2.49.0
>
next prev parent reply other threads:[~2025-06-06 17:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 19:40 [PATCHSET RFC v2 0/4] uring_cmd copy avoidance Jens Axboe
2025-06-05 19:40 ` [PATCH 1/4] io_uring: add IO_URING_F_INLINE issue flag Jens Axboe
2025-06-06 17:31 ` Caleb Sander Mateos [this message]
2025-06-06 21:02 ` Jens Axboe
2025-06-05 19:40 ` [PATCH 2/4] io_uring: add struct io_cold_def->sqe_copy() method Jens Axboe
2025-06-05 20:05 ` Jens Axboe
2025-06-06 17:36 ` Caleb Sander Mateos
2025-06-06 21:01 ` Jens Axboe
2025-06-05 19:40 ` [PATCH 3/4] io_uring/uring_cmd: get rid of io_uring_cmd_prep_setup() Jens Axboe
2025-06-06 17:37 ` Caleb Sander Mateos
2025-06-05 19:40 ` [PATCH 4/4] io_uring/uring_cmd: implement ->sqe_copy() to avoid unnecessary copies Jens Axboe
2025-06-06 17:39 ` Caleb Sander Mateos
2025-06-06 21:05 ` Jens Axboe
2025-06-06 22:08 ` Jens Axboe
2025-06-06 22:09 ` Caleb Sander Mateos
2025-06-06 23:53 ` Jens Axboe
2025-06-06 17:29 ` [PATCHSET RFC v2 0/4] uring_cmd copy avoidance Caleb Sander Mateos
2025-06-06 17:32 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2025-06-06 21:54 [PATCHSET v3 " Jens Axboe
2025-06-06 21:54 ` [PATCH 1/4] io_uring: add IO_URING_F_INLINE issue flag Jens Axboe
2025-06-07 0:49 ` Caleb Sander Mateos
2025-06-09 17:36 [PATCHSET v4 0/4] uring_cmd copy avoidance Jens Axboe
2025-06-09 17:36 ` [PATCH 1/4] io_uring: add IO_URING_F_INLINE issue flag Jens Axboe
2025-06-09 21:53 ` Caleb Sander Mateos
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='CADUfDZpeHidaeQ482gFt8n2gPVXYY0aZKvch6Di=NbZxZm28_A@mail.gmail.com' \
--to=csander@purestorage.com \
--cc=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