All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Chuck Lever <chuck.lever@oracle.com>, Jeff Layton <jlayton@kernel.org>
Cc: linux-nfs@vger.kernel.org, kbusch@kernel.org
Subject: Re: [PATCH v6 0/7] NFSD: add "NFSD DIRECT" and "NFSD DONTCACHE" IO modes
Date: Wed, 13 Aug 2025 18:41:32 -0400	[thread overview]
Message-ID: <aJ0UnNAA5J-SCtHt@kernel.org> (raw)
In-Reply-To: <20250809050257.27355-1-snitzer@kernel.org>

On Sat, Aug 09, 2025 at 01:02:50AM -0400, Mike Snitzer wrote:
> 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
> 
> This series builds on what has been staged in the nfsd-testing branch.
> 
> This code has proven to work well during my testing.  Any suggestions
> for further refinement are welcome.
> 
> Thanks,
> Mike
> 
> Changes since v5:
> - #define NFSD_READ_DIO_MIN_KB (32 << 10)
> - switch to using pre-increment from post-increment.
> - always get DIO alignment when opening regular nfsd_file (dropped
>   patch that only did if NFSD_IO_DIRECT).
> - fixed nfsd_io_cache_{read,write}_set to not set NFSD_IO_UNSPECIFIED
>   if returning -EINVAL due to unrecognized value. 
> - use a switch statement in nfsd_iter_read like nfsd_iter_write
> - Optimize nfsd_iter_read for default being buffered IO, like was done
>   for nfsd_iter_write in v5.

FYI, I've found that in general we _do_ need to verify DIO-alignment
more comprehensively. Which means I've needed to reinstate the use of
a modified iov_iter_is_aligned.

Otherwise the piece-wise checking that Keith suggested, by adding
checks to existing loops and such, results in the underlying
filesystem (XFS) returning -EINVAL due to alignment issues.

So I'm now focusing on correctness and will hopefully be posting v7 of
this patchset by the end of the week.

Mike

      parent reply	other threads:[~2025-08-13 22:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-09  5:02 [PATCH v6 0/7] NFSD: add "NFSD DIRECT" and "NFSD DONTCACHE" IO modes Mike Snitzer
2025-08-09  5:02 ` [PATCH v6 1/7] NFSD: filecache: add STATX_DIOALIGN and STATX_DIO_READ_ALIGN support Mike Snitzer
2025-08-09  5:02 ` [PATCH v6 2/7] NFSD: pass nfsd_file to nfsd_iter_read() Mike Snitzer
2025-08-09  5:02 ` [PATCH v6 3/7] NFSD: add io_cache_read controls to debugfs interface Mike Snitzer
2025-08-09  5:02 ` [PATCH v6 4/7] NFSD: add io_cache_write " Mike Snitzer
2025-08-09  5:02 ` [PATCH v6 5/7] NFSD: issue READs using O_DIRECT even if IO is misaligned Mike Snitzer
2025-08-09  5:02 ` [PATCH v6 6/7] NFSD: issue WRITEs " Mike Snitzer
2025-08-09  5:02 ` [PATCH v6 7/7] NFSD: add nfsd_analyze_read_dio and nfsd_analyze_write_dio trace events Mike Snitzer
2025-08-13 22:41 ` Mike Snitzer [this message]

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=aJ0UnNAA5J-SCtHt@kernel.org \
    --to=snitzer@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.