svn commit: r269230 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs

Xin LI delphij at FreeBSD.org
Tue Jul 29 09:36:48 UTC 2014


Author: delphij
Date: Tue Jul 29 09:36:48 2014
New Revision: 269230
URL: http://svnweb.freebsd.org/changeset/base/269230

Log:
  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
  
  MFC after:	2 weeks

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jul 29 08:42:22 2014	(r269229)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Tue Jul 29 09:36:48 2014	(r269230)
@@ -203,6 +203,7 @@ 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_meta_limit", &zfs_arc_meta_limit);
 SYSCTL_DECL(_vfs_zfs);
@@ -210,6 +211,9 @@ SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, arc_max
     "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:
@@ -1054,10 +1058,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;


More information about the svn-src-head mailing list