NFS: O_DIRECT aio and io_uring support
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest6 patches 0 repliesNew
- v15 patches 1 replySuperseded
Changes in v2 from the cover letter
- new patch exporting task_work_add() for modular builds
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | nfs: complete direct writes inline when nothing is left to dofs/ fs/ | +59 | 0 replies | |
| 2/6 | task_work: export task_work_add() to the NFS clientkernel/ | +2 | 0 replies | |
| 3/6 | nfs: run the direct write completion tail from task_workfs/ fs/ | +52 | 0 replies | |
| 4/6 | nfs: honour IOCB_NOWAIT in nfs_file_direct_write()fs/ | +19 | 0 replies | |
| 5/6 | nfs: advertise FMODE_NOWAIT on writable filesfs/ fs/ fs/ +1 more | +28 | 0 replies | |
| 6/6 | nfs: set FOP_DIO_PARALLEL_WRITEfs/ fs/ | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/6] NFS: O_DIRECT aio and io_uring support
From: Avi Kivity <[email protected]>
This series completes NFS client support for O_DIRECT writes.
Support was mostly there, but NFS did not communicate well with aio and io_uring (IOCB_NOWAIT/FMODE_NOWAIT/FOP_DIO_PARALLEL_WRITE) and scheduled work even when there was nothing to do. In addition, the series prefers io_uring task_work to the knfsiod as this avoids context switches.
Before the series, io_uring punted every write to its workqueues (due to lack of NOWAIT support). Linux-aio initiated writes directly, but all of them completed in knfsiod.
One thing is that task_work can now take the inode commit_mutex. It seems benign to me.
Performance is up 16-64% against loopback knfsd on tmpfs. Detailed results (written by AI) are available [1], both fio and my target application, ScyllaDB.
DisclAImer: Claude wrote the patches, I reviewed them to the best of
my ability. I have kernel experience but not in NFS.
[1] https://gist.github.com/avikivity/110cfc22f2c5381e473423437e9ca210
v2:
- new patch exporting task_work_add() for modular builds
Avi Kivity (6):
nfs: complete direct writes inline when nothing is left to do
task_work: export task_work_add() to the NFS client
nfs: run the direct write completion tail from task_work
nfs: honour IOCB_NOWAIT in nfs_file_direct_write()
nfs: advertise FMODE_NOWAIT on writable files
nfs: set FOP_DIO_PARALLEL_WRITE
fs/nfs/dir.c | 4 ++ fs/nfs/direct.c | 118 +++++++++++++++++++++++++++++++++++++++++++-- fs/nfs/file.c | 26 ++++++---- fs/nfs/internal.h | 2 + fs/nfs/nfs4file.c | 5 +- fs/nfs/pnfs.h | 19 ++++++++ kernel/task_work.c | 2 + 7 files changed, 162 insertions(+), 14 deletions(-)
Signature · 1 line
2.56.1