From: Pranjal Shrivastava <praan@google.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Chuck Lever <cel@kernel.org>, Christoph Hellwig <hch@lst.de>,
Matthew Wilcox <willy@infradead.org>,
linux-nfs@vger.kernel.org, Trond Myklebust <trondmy@kernel.org>,
Anna Schumaker <anna@kernel.org>,
Jeff Layton <jlayton@kernel.org>,
linux-kernel@vger.kernel.org,
Logan Gunthorpe <logang@deltatee.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
linux-pci@vger.kernel.org, linux-rdma@vger.kernel.org,
Shivaji Kant <shivajikant@google.com>,
Tom Talpey <tom@talpey.com>,
Unnati Sachan <unnatisachan@google.com>
Subject: Re: [RFC PATCH v1 5/8] nfs: tag READ/WRITE RPCs carrying P2PDMA pages
Date: Tue, 27 Oct 2026 11:44:39 +0000 [thread overview]
Message-ID: <auCOp5jphqwPX2BQ@google.com> (raw)
In-Reply-To: <20261012071020.GH27033@unreal>
On Mon, Oct 12, 2026 at 10:10:20AM +0300, Leon Romanovsky wrote:
> 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@google.com>
> > ---
> > 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`?
>
Hi Leon,
Yes. NFS O_DIRECT is page based today, and the Direct I/O series [1]
just moved it from get_page() references to FOLL_PIN pins through
iov_iter_extract_pages(), which is what DMA into user pages requires.
This series lets P2PDMA pages through the existing path, and
is_pci_p2pdma_page() is how NFS tells which RPCs carry them, the same
way the block layer does for bios.
I'm aware of Pavel's dma-buf I/O work [2], which Jens has queued for
7.4. The hook is a file operation, but the only implementation so far
is the raw block device on NVMe, where the block driver owns the
dma-buf mapping. It's also exposed through io_uring registered
buffers, while this series serves plain O_DIRECT on user buffers.
Since NFS isn't block based & its I/O goes via SUNRPC to the transport,
taking a dma-buf map instead of pages would mean reworking the NFS I/O
path end to end, which is a large + separate effort that I'm happy
to look into after this series.
Thanks,
Praan
[1] https://lore.kernel.org/all/20260814143255.861084-1-praan@google.com/
[2] https://lore.kernel.org/all/cover.1791975048.git.asml.silence@gmail.com/
next prev parent reply other threads:[~2026-10-27 11:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 23:32 [RFC PATCH v1 0/8] nfs: PCI P2PDMA for O_DIRECT over RDMA Pranjal Shrivastava
2026-10-06 23:32 ` [RFC PATCH v1 1/8] sunrpc: introduce XDRBUF_P2PDMA flag Pranjal Shrivastava
2026-10-06 23:32 ` [RFC PATCH v1 2/8] sunrpc: fail only the RPC a transport refuses Pranjal Shrivastava
2026-10-06 23:32 ` [RFC PATCH v1 3/8] xprtrdma: move P2PDMA payloads only via chunks Pranjal Shrivastava
2026-10-06 23:32 ` [RFC PATCH v1 4/8] xprtrdma: return -EREMOTEIO on P2PDMA map failure Pranjal Shrivastava
2026-10-12 7:01 ` Leon Romanovsky
2026-10-27 11:57 ` Pranjal Shrivastava
2026-10-06 23:32 ` [RFC PATCH v1 5/8] nfs: tag READ/WRITE RPCs carrying P2PDMA pages Pranjal Shrivastava
2026-10-12 7:10 ` Leon Romanovsky
2026-10-27 11:44 ` Pranjal Shrivastava [this message]
2026-10-06 23:32 ` [RFC PATCH v1 6/8] nfs: refuse P2PDMA pages with krb5i and krb5p Pranjal Shrivastava
2026-10-06 23:32 ` [RFC PATCH v1 7/8] nfs: allow LOCALIO for P2PDMA pages only as aligned direct I/O Pranjal Shrivastava
2026-10-06 23:32 ` [RFC PATCH v1 8/8] nfs: allow P2PDMA pages for O_DIRECT on RDMA mounts Pranjal Shrivastava
2026-10-07 21:20 ` [RFC PATCH v1 0/8] nfs: PCI P2PDMA for O_DIRECT over RDMA Chuck Lever
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=auCOp5jphqwPX2BQ@google.com \
--to=praan@google.com \
--cc=anna@kernel.org \
--cc=cel@kernel.org \
--cc=hch@lst.de \
--cc=jgg@ziepe.ca \
--cc=jlayton@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=shivajikant@google.com \
--cc=tom@talpey.com \
--cc=trondmy@kernel.org \
--cc=unnatisachan@google.com \
--cc=willy@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox