All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: Steve French <smfrench@gmail.com>,
	Shyam Prasad N <nspmangalore@gmail.com>,
	Rohith Surabattula <rohiths.msft@gmail.com>,
	Jeff Layton <jlayton@kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/9] iov_iter: Add a function to extract an iter's buffers to a bvec iter
Date: Mon, 30 May 2022 23:03:14 -0700	[thread overview]
Message-ID: <YpWvolJHuCWAnL62@infradead.org> (raw)
In-Reply-To: <165364824259.3334034.5837838050291740324.stgit@warthog.procyon.org.uk>

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.

  reply	other threads:[~2022-05-31  6:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 10:43 [PATCH v3 0/9] cifs: Use iov_iters down to the network transport David Howells
2022-05-27 10:44 ` [PATCH v3 1/9] iov_iter: Add a function to extract an iter's buffers to a bvec iter David Howells
2022-05-31  6:03   ` Christoph Hellwig [this message]
2022-05-27 10:44 ` [PATCH v3 2/9] iov_iter: Add a general purpose iteration function David Howells
2022-05-27 14:33   ` Al Viro
2022-05-27 10:44 ` [PATCH v3 3/9] cifs: Add some helper functions David Howells
2022-05-27 10:44 ` [PATCH v3 4/9] cifs: Add a function to read into an iter from a socket David Howells
2022-05-27 10:44 ` [PATCH v3 5/9] cifs: Change the I/O paths to use an iterator rather than a page list David Howells
2022-05-27 10:44 ` [PATCH v3 6/9] cifs: Remove unused code David Howells
2022-05-27 10:44 ` [PATCH v3 7/9] cifs: Trace writedata page wrangling David Howells
2022-05-27 10:44 ` [PATCH v3 8/9] cifs: Add some RDMA send tracepoints David Howells
2022-05-27 10:45 ` [PATCH v3 9/9] cifs, ksmbd: Fix MAX_SGE count for softiwarp David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YpWvolJHuCWAnL62@infradead.org \
    --to=hch@infradead.org \
    --cc=dhowells@redhat.com \
    --cc=jlayton@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nspmangalore@gmail.com \
    --cc=rohiths.msft@gmail.com \
    --cc=smfrench@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.