summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-08-12 00:59:19 +0000
committerdelphij <delphij@FreeBSD.org>2014-08-12 00:59:19 +0000
commitd307c6d3b7fc94a241aab28f56b9e92a10d98bee (patch)
tree9102344710de56a7edb53d457264272a04e24d77
parent63a479a6fbfba8b52dc7d41d8cf7bf3e13048dc5 (diff)
downloadFreeBSD-src-d307c6d3b7fc94a241aab28f56b9e92a10d98bee.zip
FreeBSD-src-d307c6d3b7fc94a241aab28f56b9e92a10d98bee.tar.gz
MFC r269230: MFV r269224:
Increase default ARC buf_hash_table size. When typical block size is small, the hash table could be too small, which would lead to long hash chains and limit performance for cached reads. A new loader tunable, vfs.zfs.arc_average_blocksize, have been added which allows users to override the default assumption of average (typical) block size. Old default was 65536 (64 KiB) and new default is 8192 (8 KiB). Illumos issue: 5034 ARC's buf_hash_table is too small
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
index 993484e..b04abc2 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
@@ -203,15 +203,20 @@ int zfs_arc_grow_retry = 0;
int zfs_arc_shrink_shift = 0;
int zfs_arc_p_min_shift = 0;
int zfs_disable_dup_eviction = 0;
+uint64_t zfs_arc_average_blocksize = 8 * 1024; /* 8KB */
TUNABLE_QUAD("vfs.zfs.arc_max", &zfs_arc_max);
TUNABLE_QUAD("vfs.zfs.arc_min", &zfs_arc_min);
TUNABLE_QUAD("vfs.zfs.arc_meta_limit", &zfs_arc_meta_limit);
+TUNABLE_QUAD("vfs.zfs.arc_average_blocksize", &zfs_arc_average_blocksize);
SYSCTL_DECL(_vfs_zfs);
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max, CTLFLAG_RDTUN, &zfs_arc_max, 0,
"Maximum ARC size");
SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_min, CTLFLAG_RDTUN, &zfs_arc_min, 0,
"Minimum ARC size");
+SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_average_blocksize, CTLFLAG_RDTUN,
+ &zfs_arc_average_blocksize, 0,
+ "ARC average blocksize");
/*
* Note that buffers can be in one of 6 states:
@@ -1056,10 +1061,11 @@ buf_init(void)
/*
* The hash table is big enough to fill all of physical memory
- * with an average 64K block size. The table will take up
- * totalmem*sizeof(void*)/64K (eg. 128KB/GB with 8-byte pointers).
+ * with an average block size of zfs_arc_average_blocksize (default 8K).
+ * By default, the table will take up
+ * totalmem * sizeof(void*) / 8K (1MB per GB with 8-byte pointers).
*/
- while (hsize * 65536 < (uint64_t)physmem * PAGESIZE)
+ while (hsize * zfs_arc_average_blocksize < (uint64_t)physmem * PAGESIZE)
hsize <<= 1;
retry:
buf_hash_table.ht_mask = hsize - 1;
OpenPOWER on IntegriCloud