]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Fix direct WRITE throughput regression
authorChuck Lever <chuck.lever@oracle.com>
Fri, 29 May 2020 18:14:40 +0000 (14:14 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 11 Jun 2020 17:33:48 +0000 (13:33 -0400)
commit6d317bf80ef161b3b8c7a72f6316678a41267f09
tree77afff1e2a6b81553cfa3d640411553a473d39d7
parentc3895aee4e90f43b9cdcb92d3526def7857f3d60
NFS: Fix direct WRITE throughput regression

I measured a 50% throughput regression for large direct writes.

The observed on-the-wire behavior is that the client sends every
NFS WRITE twice: once as an UNSTABLE WRITE plus a COMMIT, and once
as a FILE_SYNC WRITE.

This is because the nfs_write_match_verf() check in
nfs_direct_commit_complete() fails for every WRITE.

Buffered writes use nfs_write_completion(), which sets req->wb_verf
correctly. Direct writes use nfs_direct_write_completion(), which
does not set req->wb_verf at all. This leaves req->wb_verf set to
all zeroes for every direct WRITE, and thus
nfs_direct_commit_completion() always sets NFS_ODIRECT_RESCHED_WRITES.

This fix appears to restore nearly all of the lost performance.

Fixes: c9b255e88761 ("NFS: Fix O_DIRECT commit verifier handling")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/direct.c