Skip to content

iov_iter: allow iov_iter_get_pages_alloc to allocate more pages per call

Jeff Layton ceph-devel linux-fsdevel linux-nfs lkml lustre-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest2 patches 1 replyIn review
  2. v32 patches 37 repliesSuperseded
  3. v11 patch 0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2iov_iter: allow iov_iter_get_pages_alloc to allocate more pages per calllib/iov_iter.c+151 -290 replies
2/2ceph: switch DIO code to use iov_iter_get_pages_allocfs/ceph/file.c+3 -721 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/2] iov_iter: allow iov_iter_get_pages_alloc to allocate more pages per call

v1: Initial iteration (too many iov_iter details exposed to callers)
v2: just change iov_iter_get_pages_alloc to add more pages to the array
if the previous vector and the current one are page aligned
v3: Move maxsize handling into iov_iter_pvec_size. Add patch to make
ceph use iov_iter_get_pages_alloc instead of doing its own thing.
v4: Fix length handling when neither start nor end of iovec is page
aligned. Rework error handling when there is a change to iovec after calculating the array length. Eliminate a BUG_ON.

Currently iov_iter_get_pages_alloc doesn't actually iterate past the first element in the vector array. If you have a long array of small iovecs that are well aligned and you want to stitch them together into a single I/O, you have to try to do it yourself with multiple calls to iov_iter_get_pages.

Ceph attempts to do this, but it doesn't handle ITER_BVEC correctly, which is necessary to handle splice writes into a file open with O_DIRECT. That usually leads to a softlockup with the current code.

While I can't locate the report at the moment, ISTR that we've also had people complain in the past that the NFS client doesn't handle small iovecs well with O_DIRECT. Each iovec gets its own RPC, even when they are page-aligned. The first patch in the series fixes that as well.

This may also silimarly help lustre and 9p in that situation as well, but I don't have a great way to test that so I can't verify it.

Jeff Layton (2):
iov_iter: allow iov_iter_get_pages_alloc to allocate more pages per
call
ceph: switch DIO code to use iov_iter_get_pages_alloc

 fs/ceph/file.c |  75 +-----------------------
 lib/iov_iter.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++----------
 2 files changed, 154 insertions(+), 101 deletions(-)
Signature · 1 line
2.9.3