Re: [RFC PATCH 3/4] nfs: make nfs_page pin-aware

Christoph Hellwig
2026-04-02T05:04:30Z

This conversion really should go first as it is badly needed independent
of any P2P support. And I wonder if it should go further - currently
the NFS I/O code is using folios for buffered I/O, but pages for direct
I/O, which makes larger I/O very inefficient.

The iov_iter_extract_bvecs wrapper allows to extract bvecs instead, which
might be a good choice here either by passing down the bvecs or
converting to an nfs_page inline. Or just open coding a variant of
iov_iter_extract_bvecs that converts to nfs_page structures instead of
bvecs. This would pair with a helper similar to __bio_release_pages on
the unlock side.

> + req = nfs_page_create_from_page(dreq->ctx, pagevec[i], false,
> pgbase, pos, req_len);
>

A lot of this code reads pretty odd as it's overflowing the lines.