public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] NFSD: add "NFSD DIRECT" and "NFSD DONTCACHE" IO modes
@ 2025-07-23 15:43 Mike Snitzer
  2025-07-23 15:43 ` [PATCH v4 1/5] NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support Mike Snitzer
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Mike Snitzer @ 2025-07-23 15:43 UTC (permalink / raw)
  To: Chuck Lever, Jeff Layton; +Cc: linux-nfs

Hi,

Some workloads benefit from NFSD avoiding the page cache, particularly
those with a working set that is significantly larger than available
system memory.  This patchset introduces _optional_ support to
configure the use of O_DIRECT or DONTCACHE for NFSD's READ and WRITE
support.  The NFSD default to use page cache is left unchanged.

The performance win associated with using NFSD DIRECT was previously
summarized here:
https://lore.kernel.org/linux-nfs/aEslwqa9iMeZjjlV@kernel.org/
This picture offers a nice summary of performance gains:
https://original.art/NFSD_direct_vs_buffered_IO.jpg

Very minor changes for this v4.

Thanks,
Mike

Changes since v3:
- Fix a copy-n-paste bug in nfsd_vfs_write:
  s/nf_dio_read_offset_align/nf_dio_offset_align/
- Rename struct nfsd_dio_io to nfsd_read_dio.

Changes since v2:
- explored suggestion to use string based interface (e.g. "direct"
  instead of 3) but debugfs seems to only supports numeric values.
- shifted numeric values for debugfs interface from 0-2 to 1-3 and
  made 0 UNSPECIFIED (which is the default)
- if user specifies io_cache_read or io_cache_write mode other than 1,
  2 or 3 (via debugfs) they will get an error message
- pass a data structure to nfsd_analyze_read_dio rather than so many
  in/out params
- improved comments as requested (e.g. "Must remove first
  start_extra_page from rqstp->rq_bvec" was reworked)
- use memmove instead of opencoded shift in
  nfsd_complete_misaligned_read_dio
- dropped the still very important "lib/iov_iter: remove piecewise
  bvec length checking in iov_iter_aligned_bvec" patch because it
  needs to be handled separately.
- various other changes to improve code

Mike Snitzer (5):
  NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support
  NFSD: pass nfsd_file to nfsd_iter_read()
  NFSD: add io_cache_read controls to debugfs interface
  NFSD: add io_cache_write controls to debugfs interface
  NFSD: issue READs using O_DIRECT even if IO is misaligned

 fs/nfsd/debugfs.c          | 102 +++++++++++++++++++
 fs/nfsd/filecache.c        |  32 ++++++
 fs/nfsd/filecache.h        |   4 +
 fs/nfsd/nfs4xdr.c          |   8 +-
 fs/nfsd/nfsd.h             |  10 ++
 fs/nfsd/nfsfh.c            |   4 +
 fs/nfsd/trace.h            |  37 +++++++
 fs/nfsd/vfs.c              | 197 ++++++++++++++++++++++++++++++++++---
 fs/nfsd/vfs.h              |   2 +-
 include/linux/sunrpc/svc.h |   5 +-
 10 files changed, 383 insertions(+), 18 deletions(-)

-- 
2.44.0


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

end of thread, other threads:[~2025-07-24 13:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-23 15:43 [PATCH v4 0/5] NFSD: add "NFSD DIRECT" and "NFSD DONTCACHE" IO modes Mike Snitzer
2025-07-23 15:43 ` [PATCH v4 1/5] NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support Mike Snitzer
2025-07-23 18:58   ` Jeff Layton
2025-07-23 19:06     ` Mike Snitzer
2025-07-23 19:43       ` Mike Snitzer
2025-07-23 19:56         ` Jeff Layton
2025-07-24 13:17           ` Chuck Lever
2025-07-23 15:43 ` [PATCH v4 2/5] NFSD: pass nfsd_file to nfsd_iter_read() Mike Snitzer
2025-07-23 15:43 ` [PATCH v4 3/5] NFSD: add io_cache_read controls to debugfs interface Mike Snitzer
2025-07-23 15:43 ` [PATCH v4 4/5] NFSD: add io_cache_write " Mike Snitzer
2025-07-23 15:43 ` [PATCH v4 5/5] NFSD: issue READs using O_DIRECT even if IO is misaligned Mike Snitzer
2025-07-23 20:37 ` [PATCH v4 6/5] NFSD: filecache: only get DIO alignment attrs if NFSD_IO_DIRECT enabled modes Mike Snitzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox