mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] nfs: support FMODE_NOWAIT on O_DIRECT reads
@ 2026-05-30 22:19 Dylan Yudaken
  2026-05-30 22:19 ` [PATCH 1/2] nfs: add nowait version of nfs_start_io_direct Dylan Yudaken
  2026-05-30 22:19 ` [PATCH 2/2] nfs: expose FMODE_NOWAIT for O_DIRECT read files Dylan Yudaken
  0 siblings, 2 replies; 3+ messages in thread
From: Dylan Yudaken @ 2026-05-30 22:19 UTC (permalink / raw)
  To: trondmy, anna, linux-nfs; +Cc: axboe, io-uring, linux-kernel, Dylan Yudaken

I had noticed that io_uring always punts O_DIRECT NFS reads to a background thread
since the file does not advertise FMODE_NOWAIT.

I am not very familiar with the NFS codebase, but looking around suggests a simple change
to nfs_start_io_direct is all that is required to properly support this functionality.
On the request issue side, it seems everything in NFS is actually run in the background
(post this lock change), and the completion codepaths all look to have no similar locking
semantics.

I unfortunately do not have the means to test the performance improvement, since even
without this change my local network is the bottleneck here.
However I do suspect that there are people that would want this fix ([1]).
Applying a similar patch on that GitHub issue did give performance gains.

To convince myself this works at all I did trace io_uring events through with and
without the patch.
Using a test app ([2]) to issue O_DIRECT io_uring reads calls io_uring_queue_async_work
without this patch, while with it the call is skipped and the completion is queued into
io_uring directly from nfs_direct_read_completion.

Patch 1 here adds an unused nfs_start_io_direct_nowait which patch 2 uses in order to safely
advertise FMODE_NOWAIT.

[1]: https://github.com/axboe/liburing/issues/1499
[2]: https://github.com/DylanZA/liburing/commit/264c06f1939dfd6b6bc4c967ada5960c4f4f2db3

Dylan Yudaken (2):
  nfs: add nowait version of nfs_start_io_direct
  nfs: expose FMODE_NOWAIT for O_DIRECT read files

 fs/nfs/direct.c   |  5 ++++-
 fs/nfs/file.c     | 13 ++++++++++++-
 fs/nfs/internal.h |  1 +
 fs/nfs/io.c       | 38 ++++++++++++++++++++++++++++++++++++--
 4 files changed, 53 insertions(+), 4 deletions(-)


base-commit: 670b77dfebe7257adc0defbc48a4c43cfdf6c8f6
-- 
2.50.1


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

end of thread, other threads:[~2026-05-30 22:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-30 22:19 [PATCH 0/2] nfs: support FMODE_NOWAIT on O_DIRECT reads Dylan Yudaken
2026-05-30 22:19 ` [PATCH 1/2] nfs: add nowait version of nfs_start_io_direct Dylan Yudaken
2026-05-30 22:19 ` [PATCH 2/2] nfs: expose FMODE_NOWAIT for O_DIRECT read files Dylan Yudaken

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

all inboxes | Powered by JetHome®