Linux NFS development
 help / color / mirror / Atom feed
From: Pranjal Shrivastava <praan@google.com>
To: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>, Christoph Hellwig <hch@lst.de>,
	Christoph Hellwig <hch@infradead.org>,
	Shivaji Kant <shivajikant@google.com>
Subject: Re: [PATCH v2 0/7] nfs: Modernize Direct I/O path
Date: Tue, 16 Jun 2026 14:15:15 +0000	[thread overview]
Message-ID: <ajFac-4ZYDabeTYY@google.com> (raw)
In-Reply-To: <20260616134000.2733403-1-praan@google.com>

On Tue, Jun 16, 2026 at 01:39:53PM +0000, Pranjal Shrivastava wrote:
> Modernize the NFS Direct I/O path as a preparatory step to enable PCI
> Peer-to-Peer DMA (P2PDMA) support. Following feedback on the initial
> RFC [1], the modernization and architectural changes are split into
> this standalone series.
> 
> Currently, NFS O_DIRECT relies on the legacy iov_iter_get_pages_alloc2()
> API which does not support the pinning requirements for P2P memory.
> The implementation moves NFS to the modern iov_iter_extract_pages() API
> and migrates NFS direct I/O away from pages to use folios.
> 
> Design
> ======
> 
> 1. Pin-Awareness
> Standard NFS requests use get_page() and put_page() for memory
> management. However, memory extracted via iov_iter_extract_pages()
> requires explicit pinning.
> 
> Introduce a PG_PINNED flag and a wb_nr_pinned count to struct nfs_page.
> This allows the request lifecycle to track ownership of physical pins
> and ensure that unpinning is performed only when the I/O is complete.
> 
> 2. API Migration
> Migrate the Direct I/O path to the modern iov_iter_extract_pages()
> API. This aligns NFS with the modern extraction model and serves as
> the foundation for passing ITER_ALLOW_P2PDMA in a follow-up series.
> 
> 3. Extraction Helper and Folio Support
> Introduce a new extraction helper in direct.c to group contiguous
> pages from the same folio into a single struct nfs_page. This
> effectively migrates the Direct I/O path from being page-based to being
> folio-based.
> 
> Note: zone_device_pages_have_same_pgmap() checks are intentionally
> omitted in the extraction helper since P2PDMA enablement will be
> introduced in a follow-up series.
> 
> Bisectability
> =============
> The series attempts to remain bisectable. 
> 
> [Patches 1-2] Introduce pin-aware infrastructure and accounting.
> [Patch 3] Adds a centralized request release helper.
> [Patch 4] Migrates the Direct I/O path to iov_iter_extract_pages().
> [Patches 5-6] Implement the extraction helper and folio-based grouping.
> [Patch 7] Removes orphaned page-based helpers.
> 
> Testing
> =======
> This series has been tested with xfstests [2] on RDMA & TCP transports:
> 
>  ./check generic/091 generic/130 generic/139 generic/143 generic/154 \
>          generic/155 generic/183 generic/188 generic/190 generic/196 \
>          generic/198 generic/203 generic/214 generic/240 generic/263 \
>          generic/287 generic/290 generic/292 generic/330 generic/444 \
>          generic/450 generic/451 generic/586 generic/647 generic/708 \
>          generic/729 generic/760
> 
> The following summary was tabulated via a custom script [3] (on github).
> 

[...]

> 
> [1] https://lore.kernel.org/all/20260401194501.2269200-1-praan@google.com/
> [2] https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git

Missed [3] https://github.com/pran005/tools/blob/main/display.py

> 
> 
> [v2] 
>  - Fix data corruption in nfs_direct_extract_pages() by correctly
>    calculating intra-page offsets using offset_in_page().
>  - Fix requested_bytes accounting in direct read/write paths to only
>    increment after successful RPC scheduling.
>  - Add missing kernel-doc descriptions for the @pinned parameter in
>    nfs_page_create_from_page() and nfs_page_create_from_folio().
>  - Rebase on fs-next/

Thanks,
Praan

      parent reply	other threads:[~2026-06-16 14:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 13:39 [PATCH v2 0/7] nfs: Modernize Direct I/O path Pranjal Shrivastava
2026-06-16 13:39 ` [PATCH v2 1/7] nfs: make nfs_page pin-aware Pranjal Shrivastava
2026-06-16 13:39 ` [PATCH v2 2/7] nfs: Track number of pinned pages in nfs_page Pranjal Shrivastava
2026-06-16 13:39 ` [PATCH v2 3/7] nfs: Introduce nfs_release_request_list helper Pranjal Shrivastava
2026-06-16 13:39 ` [PATCH v2 4/7] nfs: migrate direct I/O to iov_iter_extract_pages Pranjal Shrivastava
2026-06-16 13:39 ` [PATCH v2 5/7] nfs: introduce nfs_direct_extract_pages helper Pranjal Shrivastava
2026-06-16 13:39 ` [PATCH v2 6/7] nfs: Optimize direct I/O to use folios for requests Pranjal Shrivastava
2026-06-16 15:29   ` Trond Myklebust
2026-06-16 17:23     ` Pranjal Shrivastava
2026-06-16 13:40 ` [PATCH v2 7/7] nfs: Cleanup the nfs_page_create_from_page helper Pranjal Shrivastava
2026-06-16 14:15 ` Pranjal Shrivastava [this message]

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=ajFac-4ZYDabeTYY@google.com \
    --to=praan@google.com \
    --cc=anna@kernel.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=shivajikant@google.com \
    --cc=trondmy@kernel.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