Re: [PATCHv3 2/5] io_uring: add support for kernel registered bvecs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx> 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.




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux