HomeFreeBSD

nfscl: Add a "has acquired a delegation" flag for delegations

Description

nfscl: Add a "has acquired a delegation" flag for delegations

A problem was reported via email, where a large (130000+) accumulation
of NFSv4 opens on an NFSv4 mount caused significant lock contention
on the mutex used to protect the client mount's open/lock state.
Although the root cause for the accumulation of opens was not
resolved, it is obvious that the NFSv4 client is not designed to
handle 100000+ opens efficiently.

For a common case where delegations are not being issued by the
NFSv4 server, the code acquires the mutex lock for open/lock state,
finds the delegation list empty and just unlocks the mutex and returns.
This patch adds an NFS mount point flag that is set when a delegation
is issued for the mount. Then the patched code checks for this flag
before acquiring the open/lock mutex, avoiding the need to acquire
the lock for the case where delegations are not being issued by the
NFSv4 server.
This change appears to be performance neutral for a small number
of opens, but should reduce lock contention for a large number of opens
for the common case where server is not issuing delegations.

This commit should not affect the high level semantics of delegation
handling.

(cherry picked from commit 5e5ca4c8fc53d31bf71e182e08c4ccd8290428c7)

Details

Provenance
rmacklemAuthored on Jun 9 2021, 3:00 PM
Parents
rGb1caf1920f83: nfscl: Fix generation of va_fsid for a tree of NFSv4 server file systems
Branches
Unknown
Tags
Unknown