linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v8 0/9] NFS DIRECT: align misaligned DIO for LOCALIO
@ 2025-08-15 23:29 Mike Snitzer
  2025-08-15 23:29 ` [PATCH v8 1/9] nfs/localio: avoid bouncing LOCALIO if nfs_client_is_local() Mike Snitzer
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Mike Snitzer @ 2025-08-15 23:29 UTC (permalink / raw)
  To: Trond Myklebust, Anna Schumaker; +Cc: linux-nfs

Hi,

NFS and LOCALIO in particular benefit from avoiding the page cache for
workloads that have a working set that is significantly larger than
available system memory. Enter: NFS DIRECT, which makes it possible to
always enable LOCALIO to use O_DIRECT even if the IO is not
DIO-aligned.

Changes since v7:
- Reinstate use of iov_iter_aligned_bvec in terms of local helper
  nfs}_iov_iter_aligned_bvec().
  - Otherwise LOCALIO could send misaligned DIO to XFS, which would
    rightly respond with -EINVAL.
- Add WARN_ON_ONCE to LOCALIO if XFS returns -EINVAL for misaligned IO.
  - Serves as canary for something that shouldn't ever happen.
- Simplify NFS DIRECT's READ support to not expand the READ with
  DIO-aligned front-pad for a misaligned IO.
  - This ensures symmetry with NFS DIRECT's WRITE support -- so both
    READ and WRITE can have a misaligned head and/or tail for any
    given misaligned DIO. Can backfill expanding READ's head to be
    DIO-aligned in future but in practice the increase in complexity
    isn't worth the risk initially.
- Eliminate LOCALIO's support for falling back to NFSD to handle
  misaligned DIO READs.
  - In practice the extra SUNRPC/XDR work needed to go over the
    network isn't worth it. Especially given that LOCALIO can now
    handle misaligned DIO READs (albeit with a possible misaligned
    head that is issued with buffered IO).

Earlier changelog was provided in v7's 0th patch header, see:
https://lore.kernel.org/linux-nfs/20250805232106.8656-1-snitzer@kernel.org/

All review appreciated, thanks.
Mike

Mike Snitzer (9):
  nfs/localio: avoid bouncing LOCALIO if nfs_client_is_local()
  nfs/localio: make trace_nfs_local_open_fh more useful
  nfs/localio: avoid issuing misaligned IO using O_DIRECT
  nfs/localio: refactor iocb and iov_iter_bvec initialization
  nfs/localio: refactor iocb initialization
  nfs/direct: add misaligned READ handling
  nfs/direct: add misaligned WRITE handling
  nfs/direct: add tracepoints for misaligned DIO READ and WRITE support
  NFS: add basic STATX_DIOALIGN and STATX_DIO_READ_ALIGN support

 fs/nfs/direct.c            | 133 +++++++++++++++++---
 fs/nfs/inode.c             |  15 +++
 fs/nfs/internal.h          |  13 ++
 fs/nfs/localio.c           | 249 ++++++++++++++++++++++++-------------
 fs/nfs/nfstrace.h          |  64 +++++++++-
 fs/nfs/pagelist.c          |   9 +-
 fs/nfsd/localio.c          |  11 ++
 include/linux/nfs_page.h   |   1 +
 include/linux/nfslocalio.h |   2 +
 9 files changed, 394 insertions(+), 103 deletions(-)

-- 
2.44.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-08-15 23:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 23:29 [PATCH v8 0/9] NFS DIRECT: align misaligned DIO for LOCALIO Mike Snitzer
2025-08-15 23:29 ` [PATCH v8 1/9] nfs/localio: avoid bouncing LOCALIO if nfs_client_is_local() Mike Snitzer
2025-08-15 23:29 ` [PATCH v8 2/9] nfs/localio: make trace_nfs_local_open_fh more useful Mike Snitzer
2025-08-15 23:29 ` [PATCH v8 3/9] nfs/localio: avoid issuing misaligned IO using O_DIRECT Mike Snitzer
2025-08-15 23:29 ` [PATCH v8 4/9] nfs/localio: refactor iocb and iov_iter_bvec initialization Mike Snitzer
2025-08-15 23:29 ` [PATCH v8 5/9] nfs/localio: refactor iocb initialization Mike Snitzer
2025-08-15 23:30 ` [PATCH v8 6/9] nfs/direct: add misaligned READ handling Mike Snitzer
2025-08-15 23:30 ` [PATCH v8 7/9] nfs/direct: add misaligned WRITE handling Mike Snitzer
2025-08-15 23:30 ` [PATCH v8 8/9] nfs/direct: add tracepoints for misaligned DIO READ and WRITE support Mike Snitzer
2025-08-15 23:30 ` [PATCH v8 9/9] NFS: add basic STATX_DIOALIGN and STATX_DIO_READ_ALIGN support Mike Snitzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).