Re: [PATCH 12/26] iov_iter: Add a segmented queue of bio_vec[]
Paulo Alcantara <[email protected]> Sat, 28 Mar 2026 15:39:55 -0300
| Newsgroups | dev.linux.lists.v9fs,dev.linux.lists.netfs,org.kernel.vger.ceph-devel,org.kernel.vger.linux-block,org.kernel.vger.linux-cifs,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-nfs,org.ozlabs.lists.linux-erofs |
|---|---|
| Message-ID | <[email protected]> |
David Howells <[email protected]> writes: > Add the concept of a segmented queue of bio_vec[] arrays. This allows an > indefinite quantity of elements to be handled and allows things like > network filesystems and crypto drivers to glue bits on the ends without > having to reallocate the array. > > The bvecq struct that defines each segment also carries capacity/usage > information along with flags indicating whether the constituent memory > regions need freeing or unpinning and the file position of the first > element in a segment. The bvecq structs are refcounted to allow a queue to > be extracted in batches and split between a number of subrequests. > > The bvecq can have the bio_vec[] it manages allocated in with it, but this > is not required. A flag is provided for if this is the case as comparing > ->bv to ->__bv is not sufficient to detect this case. > > Add an iterator type ITER_BVECQ for it. This is intended to replace > ITER_FOLIOQ (and ITER_XARRAY). > > Note that the prev pointer is only really needed for iov_iter_revert() and > could be dispensed with if struct iov_iter contained the head information > as well as the current point. > > Signed-off-by: David Howells <[email protected]> > cc: Paulo Alcantara <[email protected]> > cc: Matthew Wilcox <[email protected]> > cc: Christoph Hellwig <[email protected]> > cc: Jens Axboe <[email protected]> > cc: [email protected] > cc: [email protected] > cc: [email protected] > --- > include/linux/bvecq.h | 46 ++++++ > include/linux/iov_iter.h | 63 +++++++- > include/linux/uio.h | 11 ++ > lib/iov_iter.c | 288 ++++++++++++++++++++++++++++++++++++- > lib/scatterlist.c | 66 +++++++++ > lib/tests/kunit_iov_iter.c | 180 +++++++++++++++++++++++ > 6 files changed, 649 insertions(+), 5 deletions(-) > create mode 100644 include/linux/bvecq.h Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]>