Re: [PATCH v3 1/3] NFSD: avoid DONTCACHE for misaligned ends of misaligned DIO WRITE

Mike Snitzer
2025-11-05T17:33:34Z

On Wed, Nov 05, 2025 at 09:58:28AM -0500, Chuck Lever wrote:
> On 11/5/25 1:19 AM, Mike Snitzer wrote:
> > NFSD_IO_DIRECT can easily improve streaming misaligned WRITE
> > performance if it uses buffered IO (without DONTCACHE) for the
> > misaligned end segment(s) and O_DIRECT for the aligned middle
> > segment's IO.
> >
> > On one capable testbed, this commit improved streaming 47008 byte
> > write performance from 0.3433 GB/s to 1.26 GB/s.
> >
> > Signed-off-by: Mike Snitzer <snitzer@kernel.org>
> > ---
> > fs/nfsd/vfs.c | 10 +++++++++-
> > 1 file changed, 9 insertions(+), 1 deletion(-)
> >
> > v3: drop unrelated change to avoid DONTCACHE if READ is less than 32K
>
> The direct code path now handles the "no support for direct I/O" case
> in exactly one spot: the "no_dio" label in nfsd_write_dio_iters_init().
>
> So it seems to me that it would be slightly friendlier overall to not
> set DONTCACHE in nfsd_direct_write(), but then set it just after the
> "no_dio" label. The nf pointer is available in the nfsd_write_dio_args
> structure.

Sure, will post a v4 of this series.