]> git.itanic.dy.fi Git - linux-stable/commit
nfsd: Reduce contention for the nfsd_file nf_rwsem
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Thu, 17 Jun 2021 23:26:52 +0000 (19:26 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:02:21 +0000 (16:02 +0200)
commitd1f295ac1e99b2666c4b7bd77aa7133a9a673898
tree976c34231bda800c145ed3538e9a9ed7e234a2d1
parent7284dab07e4d51d453cc42851fae9ec4fac6ef2f
nfsd: Reduce contention for the nfsd_file nf_rwsem

[ Upstream commit 474bc334698df98ce07c890f1898c7e7f389b0c7 ]

When flushing out the unstable file writes as part of a COMMIT call, try
to perform most of of the data writes and waits outside the semaphore.

This means that if the client is sending the COMMIT as part of a memory
reclaim operation, then it can continue performing I/O, with contention
for the lock occurring only once the data sync is finished.

Fixes: 5011af4c698a ("nfsd: Fix stable writes")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Tested-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/vfs.c