HomeFreeBSD

nfscl: Use hash lists to improve expected search performance for opens

Description

nfscl: Use hash lists to improve expected search performance for opens

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. When searching for an open,
usually for a match by file handle, a linear search of all opens
is done.

Commit 3f7e14ad9345 added a hash table of lists hashed on file handle
for the opens. This patch uses the hash lists for searching for
a matching open based of file handle instead of an exhaustive
linear search of all opens.
This change appears to be performance neutral for a small number
of opens, but should improve expected performance for a large
number of opens.

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

(cherry picked from commit 96b40b896772bbce5f93d62eaa640e1eb51b4a30)

Details

Provenance
rmacklemAuthored on May 28 2021, 2:08 AM
Parents
rG624a723a955b: nfscl: Use hash lists to improve expected search performance for opens
Branches
Unknown
Tags
Unknown