NFSD: keep direct-mode I/O out of the page cache and elide COMMITs
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest10 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/10 | NFSD: interlock the use of NFSD_IO_DIRECT for NFS READ and WRITEDocumentation/ fs/ | +83 | 6 replies | |
| 2/10 | NFSD: mark the direct middle of a split WRITE IOCB_DONTCACHE as wellDocumentation/ fs/ | +19 | 0 replies | |
| 3/10 | NFSD: only split a direct-mode WRITE for a worthwhile direct middleDocumentation/ fs/ fs/ +1 more | +79 | 0 replies | |
| 4/10 | NFSD: do not use direct I/O for a READ smaller than its alignmentDocumentation/ fs/ | +10 | 0 replies | |
| 5/10 | NFSD: Enable return of an updated stable_how to NFS clientsfs/ fs/ fs/ +3 more | +42 | 0 replies | |
| 6/10 | NFSD: let a direct-mode WRITE raise stable_how and elide the client's COMMITDocumentation/ fs/ fs/ +1 more | +52 | 0 replies | |
| 7/10 | NFSD: persist a synchronous direct-mode WRITE once, after all of its segmentsfs/ | +19 | 0 replies | |
| 8/10 | NFSD: keep boundary page of a split direct-mode WRITE until both writers completeDocumentation/ fs/ | +151 | 0 replies | |
| 9/10 | NFSD: add direct_misaligned_dontcache debugfs knobDocumentation/ fs/ fs/ +1 more | +49 | 0 replies | |
| 10/10 | NFSD: add tracing for how direct-mode READ and WRITE are servicedDocumentation/ fs/ fs/ +1 more | +183 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/10] NFSD: keep direct-mode I/O out of the page cache and elide COMMITs
Hi,
This series builds on NFSD_IO_DIRECT. When a READ or WRITE in a direct mode cannot be direct I/O it now falls back to DONTCACHE rather than to cached buffered I/O, a direct-mode WRITE can report the stability it actually has so the client skips its COMMIT, and new tracepoints show which path each request took.
Patch 1 interlocks io_cache_read and io_cache_write so READ and WRITE are never left on opposite sides of the buffered/direct divide.
Patches 2-4 cover what cannot or should not be direct: the direct middle of a split WRITE is also marked IOCB_DONTCACHE, for when XFS falls back to buffered I/O (-ENOTBLK); a WRITE is split only when that buys a worthwhile direct middle (direct_misaligned_num_pages, default 2); and a READ smaller than its alignment no longer costs a full aligned device read.
Patch 5 is Chuck's "Enable return of an updated stable_how to NFS clients", reworked onto the @iocb_flags argument nfsd_write() now takes in nfsd-next. The Reviewed-by tags from its first posting are dropped because the argument changed.
Patch 6 adds io_cache_write modes 3 and 4, which issue direct I/O like NFSD_IO_DIRECT and raise the reply's stable_how to at least DATA_SYNC or FILE_SYNC. On a pNFS flexfiles share where every write is split across two data servers, the COMMITs alone cost NFSD_IO_DIRECT 31% more server CPU and 42% more client CPU for the same bytes.
Patch 7 persists a synchronous direct-mode WRITE once, after all of its segments, instead of up to three fsyncs per WRITE.
Patch 8 keeps the page that two misaligned WRITEs share in the page cache until both have written it, so the second one no longer has to read it back from disk: with 32 interleaved writers, 704 device reads for 42895 WRITEs where there were 45144 for 45664.
Patch 9 (Jonathan) adds the direct_misaligned_dontcache debugfs knob, default Y; set to N, the parts of a direct-mode WRITE that cannot be direct use cached buffered I/O instead of DONTCACHE.
Patch 10 adds tracepoints for how each direct-mode READ and WRITE was serviced, including why a WRITE was not direct.
Documentation/filesystems/nfs/nfsd-io-modes.rst is updated throughout. The series applies to cel/nfsd-next (ac04dab23b5f) and each patch builds cleanly with W=1.
All review appreciated, thanks.
Mike
Chuck Lever (1):
NFSD: Enable return of an updated stable_how to NFS clients
Jonathan Flynn (1):
NFSD: add direct_misaligned_dontcache debugfs knob
Mike Snitzer (8):
NFSD: interlock the use of NFSD_IO_DIRECT for NFS READ and WRITE
NFSD: mark the direct middle of a split WRITE IOCB_DONTCACHE as well
NFSD: only split a direct-mode WRITE for a worthwhile direct middle
NFSD: do not use direct I/O for a READ smaller than its alignment
NFSD: let a direct-mode WRITE raise stable_how and elide the client's COMMIT
NFSD: persist a synchronous direct-mode WRITE once, after all of its segments
NFSD: keep boundary page of a split direct-mode WRITE until both writers complete
NFSD: add tracing for how direct-mode READ and WRITE are serviced
.../filesystems/nfs/nfsd-io-modes.rst | 164 ++++++++- fs/nfsd/debugfs.c | 94 +++++- fs/nfsd/nfs3proc.c | 16 +- fs/nfsd/nfs4proc.c | 15 +- fs/nfsd/nfsd.h | 4 + fs/nfsd/nfsproc.c | 3 +- fs/nfsd/trace.h | 90 +++++ fs/nfsd/vfs.c | 318 +++++++++++++++--- fs/nfsd/vfs.h | 26 +- fs/nfsd/xdr3.h | 2 +- 10 files changed, 665 insertions(+), 67 deletions(-)
Signature · 1 line
2.52.0