Re: [PATCH] block: add bio_iov_iter_nvecs for figuring out nr_vecs

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

 



On 01/12/2020 12:59, Christoph Hellwig wrote:
> On Tue, Dec 01, 2020 at 12:52:51PM +0000, Matthew Wilcox wrote:
>> But the only reason we want to know 'nr_vecs' is so we can allocate a
>> BIO which has that many vecs, right?  But we then don't actually use the
>> vecs in the bio because we use the ones already present in the iter.
>> That was why I had it return 1, not nr_vecs.
>>
>> Did I miss something?
> 
> Right now __bio_iov_bvec_add_pages does not reuse the bvecs in the
> iter.  That being said while we are optmizing this path we might a well
> look into reusing them..

I was thinking about memcpy bvec instead of iterating as a first step,
and then try to reuse passed in bvec.

A thing that doesn't play nice with that is setting BIO_WORKINGSET in
__bio_add_page(), which requires to iterate all pages anyway. I have no
clue what it is, so rather to ask if we can optimise it out somehow?
Apart from pre-computing for specific cases...

E.g. can pages of a single bvec segment be both in and out of a working
set? (i.e. PageWorkingset(page)).

-- 
Pavel Begunkov



[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