From: Mike Snitzer <snitzer@kernel.org>
To: Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna.schumaker@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH v8 0/9] NFS DIRECT: align misaligned DIO for LOCALIO
Date: Fri, 15 Aug 2025 19:29:54 -0400 [thread overview]
Message-ID: <20250815233003.55071-1-snitzer@kernel.org> (raw)
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
next reply other threads:[~2025-08-15 23:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 23:29 Mike Snitzer [this message]
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
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=20250815233003.55071-1-snitzer@kernel.org \
--to=snitzer@kernel.org \
--cc=anna.schumaker@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@hammerspace.com \
/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;
as well as URLs for NNTP newsgroup(s).