Re: [RFC PATCH v1 5/8] nfs: tag READ/WRITE RPCs carrying P2PDMA pages
From: Leon Romanovsky
Date: Mon Oct 12 2026 - 03:10:30 EST
On Tue, Oct 06, 2026 at 11:32:45PM +0000, Pranjal Shrivastava wrote:
> A transport must know when an RPC's payload pages are P2PDMA memory,
> so it can move them by DMA or refuse the RPC.
>
> Check each page as nfs_generic_pgio() builds the page array, and
> record the result in nfs_pgio_args. The READ and WRITE encoders of
> every NFS version then set XDRBUF_P2PDMA on the buffer holding the
> payload.
>
> Additionally, avoid using READ_PLUS when the pages are P2PDMA memory.
>
> Signed-off-by: Pranjal Shrivastava <praan@xxxxxxxxxx>
> ---
> fs/nfs/nfs2xdr.c | 4 ++++
> fs/nfs/nfs3xdr.c | 4 ++++
> fs/nfs/nfs4proc.c | 3 +++
> fs/nfs/nfs4xdr.c | 4 ++++
> fs/nfs/pagelist.c | 2 ++
> include/linux/nfs_xdr.h | 1 +
> 6 files changed, 18 insertions(+)
<...>
> +++ b/fs/nfs/pagelist.c
> @@ -970,6 +970,8 @@ int nfs_generic_pgio(struct nfs_pageio_descriptor *desc,
> if (pageused > pagecount)
> goto full;
> *pages++ = last_page = page;
> + if (is_pci_p2pdma_page(page))
> + hdr->args.p2pdma = true;
Should we allow wider use of is_pci_p2pdma_page()? Does NFS require
`struct page`?
Thanks