[PATCH v8 0/9] NFS DIRECT: align misaligned DIO for LOCALIO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx/

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





[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux