Re: [PATCH V10 09/19] block: introduce bio_bvecs()

From
Ming Lei <hidden>
Date
2018-11-21 10:19:38
Also in
dm-devel, linux-bcache, linux-block, linux-btrfs, linux-ext4, linux-fsdevel, linux-mm, linux-xfs, lkml
Reply to
Sagi Grimberg, 2018-11-21
On Tue, Nov 20, 2018 at 09:35:07PM -0800, Sagi Grimberg wrote:
quoted
quoted
Wait, I see that the bvec is still a single array per bio. When you said
a table I thought you meant a 2-dimentional array...
I mean a new 1-d table A has to be created for multiple bios in one rq,
and build it in the following way

            rq_for_each_bvec(tmp, rq, rq_iter)
                     *A = tmp;

Then you can pass A to iov_iter_bvec() & send().

Given it is over TCP, I guess it should be doable for you to preallocate one
256-bvec table in one page for each request, then sets the max segment size as
(unsigned int)-1, and max segment number as 256, the preallocated table
should work anytime.
256 bvec table is really a lot to preallocate, especially when its not
needed, I can easily initialize the bvec_iter on the bio bvec. If this
involves preallocation of the worst-case than I don't consider this to
be an improvement.
If you don't provide one single bvec table, I understand you may not send
this req via one send().

The bvec_iter initialization is easy to do:

	bvec_iter = bio->bi_iter

when you move to a new a bio, please refer to  __bio_for_each_bvec() or
__bio_for_each_segment().

Thanks,
Ming
Thread (102 messages) 102 messages, 8 authors, last reply 2018-11-21
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help