mirror_zfs/module
Brian Behlendorf 34dbc618f5
Reduce dbuf_find() lock contention
Holding a dbuf is a common operation which can become highly contended
in dbuf_find() when acquiring the dbuf hash mutex.  This is particularly
true on Linux when reading/writing volumes since by default up to 32
threads from the zvol_taskq may be taking a hold of the same dbuf.
This should also be observable on FreeBSD as long as there are enough
processes accessing the volume concurrently.

This is further aggregrated by the fact that only the block id will
be unique when calculating the dbuf hash for a single volume.  The
objset id, object id, and level will be the same for data blocks.
This has been observed to result in a somehwat less than uniform hash
distribution and a longer than expected max hash chain depth (~20)
on a large memory system (256 GB) using volumes.

This commit improves the siutation by switching the hash mutex to
an rwlock to allow concurrent lookups, and increasing DBUF_RWLOCKS
from 2048 to 8192 to further reduce the odds of a hash collision.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13405
2022-05-04 11:17:29 -07:00
..
avl linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
icp linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
lua linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
nvpair linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
os Speed up WB_SYNC_NONE when a WB_SYNC_ALL occurs simultaneously 2022-05-03 13:23:26 -07:00
unicode linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
zcommon Improve zpool status output, list all affected datasets 2022-04-25 17:25:42 -07:00
zfs Reduce dbuf_find() lock contention 2022-05-04 11:17:29 -07:00
zstd Silence unused-but-set-variable warnings 2022-04-29 14:21:11 -07:00
.gitignore Cleanup linux module kbuild files 2020-06-10 09:24:15 -07:00
Kbuild.in linux: module: weld all but spl.ko into zfs.ko 2022-04-20 13:28:24 -07:00
Makefile.bsd Fix ACL checks for NFS kernel server 2022-03-18 06:47:57 -06:00
Makefile.in linux: module: uninstall legacy modules on (un)installation 2022-04-20 13:28:54 -07:00