public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Keith Busch <kbusch@meta.com>,
	ming.lei@redhat.com, asml.silence@gmail.com,
	linux-block@vger.kernel.org, io-uring@vger.kernel.org,
	bernd@bsbernd.com, csander@purestorage.com,
	linux-nvme@lists.infradead.org
Subject: Re: [PATCHv7 1/6] io_uring/rw: move fixed buffer import to issue path
Date: Thu, 27 Feb 2025 14:46:26 -0700	[thread overview]
Message-ID: <Z8DdMoScpHMzYrrh@kbusch-mbp> (raw)
In-Reply-To: <d1ff0d23-07a4-4123-b30f-446cf849814a@kernel.dk>

On Wed, Feb 26, 2025 at 01:20:24PM -0700, Jens Axboe wrote:
> +static int io_rw_do_import(struct io_kiocb *req, int ddir)
> +{
> +	if (!io_do_buffer_select(req)) {
> +		struct io_async_rw *io = req->async_data;
> +		int ret;
> +
> +		ret = io_import_rw_buffer(ddir, req, io, 0);
> +		if (unlikely(ret))
> +			return ret;
> +	}
> +
> +	return 0;
> +}
> +
> +static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
> +		      int ddir)
> +{
> +	int ret;
> +
> +	ret = __io_prep_rw(req, sqe, ddir);
> +	if (unlikely(ret))
> +		return ret;
> +
> +	return io_rw_do_import(req, ddir);
> +}

...

>  static int io_prep_rwv(struct io_kiocb *req, const struct io_uring_sqe *sqe,
>  		       int ddir)
>  {
> -	const bool do_import = !(req->flags & REQ_F_BUFFER_SELECT);
>  	int ret;
>  
> -	ret = io_prep_rw(req, sqe, ddir, do_import);
> +	ret = io_prep_rw(req, sqe, ddir);
>  	if (unlikely(ret))
>  		return ret;
> -	if (do_import)
> -		return 0;
> +	if (!(req->flags & REQ_F_BUFFER_SELECT))
> +		return io_rw_do_import(req, ddir);

Not sure if I'm missing something subtle here, but wanted to point out
I've changed the above in the version I'm about to send: io_prep_rw()
already calls io_rw_do_import(), so we can just return 0 here.

  reply	other threads:[~2025-02-27 21:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-26 18:20 [PATCHv7 0/6] ublk zero copy support Keith Busch
2025-02-26 18:20 ` [PATCHv7 1/6] io_uring/rw: move fixed buffer import to issue path Keith Busch
2025-02-26 19:04   ` Jens Axboe
2025-02-26 20:20     ` Jens Axboe
2025-02-27 21:46       ` Keith Busch [this message]
2025-02-26 18:20 ` [PATCHv7 2/6] io_uring: add support for kernel registered bvecs Keith Busch
2025-02-26 20:36   ` Jens Axboe
2025-02-27 15:54   ` Pavel Begunkov
2025-02-27 16:04     ` Jens Axboe
2025-02-27 22:45     ` Keith Busch
2025-02-28 12:19       ` Pavel Begunkov
2025-02-26 18:20 ` [PATCHv7 3/6] nvme: map uring_cmd data even if address is 0 Keith Busch
2025-02-26 18:20 ` [PATCHv7 4/6] ublk: zc register/unregister bvec Keith Busch
2025-02-26 18:40   ` Jens Axboe
2025-02-26 18:21 ` [PATCHv7 5/6] io_uring: add abstraction for buf_table rsrc data Keith Busch
2025-02-26 18:21 ` [PATCHv7 6/6] io_uring: cache nodes and mapped buffers Keith Busch
2025-02-26 18:48   ` Jens Axboe
2025-02-26 19:36   ` Jens Axboe
2025-02-26 19:43     ` Jens Axboe
2025-02-26 19:58       ` Jens Axboe
2025-02-26 20:00         ` Keith Busch

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=Z8DdMoScpHMzYrrh@kbusch-mbp \
    --to=kbusch@kernel.org \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bernd@bsbernd.com \
    --cc=csander@purestorage.com \
    --cc=io-uring@vger.kernel.org \
    --cc=kbusch@meta.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=ming.lei@redhat.com \
    /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