freebsd-skq/sys/fs/nfsclient
Rick Macklem 724072ab1d 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 3f7e14ad93 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 patch also moves any found match to the front
of the hash list, to try and maintain the hash lists in recently
used ordering (least recently used at the end of the list).

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

MFC after:	2 weeks
2021-05-25 14:19:29 -07:00
..
nfs_clbio.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-02-28 14:53:54 -08:00
nfs_clcomsubs.c nfscl: Add support for va_birthtime to NFSv4 2021-05-07 17:30:56 -07:00
nfs_clkdtrace.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clkrpc.c fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs_clnfsiod.c Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many) 2020-02-26 14:26:36 +00:00
nfs_clnode.c nfscl: add check for NULL clp and forced dismounts to nfscl_delegreturnvp() 2021-04-27 17:30:16 -07:00
nfs_clport.c nfscl: Delete unneeded redundant MODULE_DEPEND() calls 2021-05-10 17:34:29 -07:00
nfs_clrpcops.c nfscl: Add support for va_birthtime to NFSv4 2021-05-07 17:30:56 -07:00
nfs_clstate.c nfscl: Use hash lists to improve expected search performance for opens 2021-05-25 14:19:29 -07:00
nfs_clsubs.c nfsclient: add nfs node locking around uses of n_direofoffset 2021-02-28 14:53:54 -08:00
nfs_clvfsops.c nfscl: Delete unneeded redundant MODULE_DEPEND() calls 2021-05-10 17:34:29 -07:00
nfs_clvnops.c nfscl: Add support for va_birthtime to NFSv4 2021-05-07 17:30:56 -07:00
nfs_kdtrace.h fs: clean up empty lines in .c and .h files 2020-09-01 21:18:40 +00:00
nfs.h Remove "struct ucred*" argument from vtruncbuf 2019-05-24 20:27:50 +00:00
nfsmount.h Add a new "tlscertname" NFS mount option. 2020-12-23 13:42:55 -08:00
nfsnode.h Fix interface between nfsclient and vnode pager. 2019-10-22 16:17:38 +00:00
nlminfo.h sys/fs: further adoption of SPDX licensing ID tags. 2017-11-27 15:15:37 +00:00