lkml.org 
[lkml]   [2022]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/9] iov_iter: Add a function to extract an iter's buffers to a bvec iter
On Fri, May 27, 2022 at 11:44:02AM +0100, David Howells wrote:
> Copy cifs's setup_aio_ctx_iter() and to lib/iov_iter.c and generalise it as
> extract_iter_to_iter(). This allocates and sets up an array of bio_vecs
> for all the page fragments in an I/O iterator and sets a second supplied
> iterator to bvec-type pointing to the array.
>
> This is can be used when setting up for a direct I/O or an asynchronous I/O
> to set up a record of the page fragments that are going to contribute to
> the buffer, paging them all in to prevent DIO->mmap loops and allowing the
> original iterator to be deallocated (it may be on the stack of the caller).
>
> Note that extract_iter_to_iter() doesn't actually need to make a separate
> allocation for the page array. It can place the page array at the end of
> the bvec array storage, provided it traverses both arrays from the 0th
> element forwards.

I really do not like this as a general purpose helper. This is an odd
quirk that we really generally should not needed unless you have very
convoluted locking. So please keep it inside of cifs.

\
 
 \ /
  Last update: 2022-05-31 08:04    [W:0.123 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site