public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@kernel.org>
To: Caleb Sander Mateos <csander@purestorage.com>
Cc: Keith Busch <kbusch@meta.com>,
	ming.lei@redhat.com, asml.silence@gmail.com, axboe@kernel.dk,
	linux-block@vger.kernel.org, io-uring@vger.kernel.org,
	bernd@bsbernd.com
Subject: Re: [PATCHv3 2/5] io_uring: add support for kernel registered bvecs
Date: Tue, 18 Feb 2025 12:59:40 -0700	[thread overview]
Message-ID: <Z7TmrB4_aBnZdFbo@kbusch-mbp> (raw)
In-Reply-To: <CADUfDZpbb0mtGSRSqcepXnM9sijP6-3WAZnzUJrDGbC0AuXTrg@mail.gmail.com>

On Fri, Feb 14, 2025 at 12:38:54PM -0800, Caleb Sander Mateos wrote:
> On Fri, Feb 14, 2025 at 7:45 AM Keith Busch <kbusch@meta.com> wrote:
> > +
> > +       nr_bvecs = blk_rq_nr_phys_segments(rq);
> 
> Is this guaranteed to match the number of bvecs in the request?

Yes.

> Wouldn't the number of physical segments depend on how the block
> device splits the bvecs? 

Also yes.

>lo_rw_aio() uses rq_for_each_bvec() to count
> the number of bvecs, for example.

Hm, that seems unnecessary. The request's nr_phys_segments is
initialized to the number of bvecs rather than page segments, so it can
be used instead of recounting them from a given struct request.

The initial number of physical segments for a request is set in
bio_split_rw_at(), which uses bio_for_each_bvec(). That's what
rq_for_each_bvec would use, too. The same is used for any bio's that get
merged into the bio.

  reply	other threads:[~2025-02-18 19:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 15:43 [PATCHv3 0/5] ublk zero-copy support Keith Busch
2025-02-14 15:43 ` [PATCHv3 1/5] io_uring: move fixed buffer import to issue path Keith Busch
2025-02-18 20:32   ` Caleb Sander Mateos
2025-02-14 15:43 ` [PATCHv3 2/5] io_uring: add support for kernel registered bvecs Keith Busch
2025-02-14 20:38   ` Caleb Sander Mateos
2025-02-18 19:59     ` Keith Busch [this message]
2025-02-18 20:20       ` Caleb Sander Mateos
2025-02-14 15:43 ` [PATCHv3 3/5] ublk: zc register/unregister bvec Keith Busch
2025-02-14 15:43 ` [PATCHv3 4/5] io_uring: add abstraction for buf_table rsrc data Keith Busch
2025-02-14 15:43 ` [PATCHv3 5/5] io_uring: cache nodes and mapped buffers Keith Busch
2025-02-15  2:22   ` Caleb Sander Mateos
2025-02-16 22:43     ` Caleb Sander Mateos
2025-02-18 20:12       ` Keith Busch
2025-02-18 20:45         ` Caleb Sander Mateos
2025-02-18 20:09     ` Keith Busch
2025-02-18 20:42       ` Caleb Sander Mateos
2025-02-18 21:12         ` 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=Z7TmrB4_aBnZdFbo@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=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