summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Wilson <george.wilson@delphix.com>2017-03-15 09:06:24 -0400
committerPrakash Surya <prakash.surya@delphix.com>2018-03-21 08:24:55 -0700
commit268bbb2a2fa79c36d4695d13a595ba50a7754b76 (patch)
treed8971144a64ad4ec1f32543fe107f86c9e49668e
parent9be12bd737714550277bd02b0c693db560976990 (diff)
downloadillumos-joyent-268bbb2a2fa79c36d4695d13a595ba50a7754b76.tar.gz
9188 increase size of dbuf cache to reduce indirect block decompression
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Prashanth Sreenivasa <pks@delphix.com> Reviewed by: Paul Dagnelie <pcd@delphix.com> Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com> Reviewed by: Allan Jude <allanjude@freebsd.org> Reviewed by: Igor Kozhukhov <igor@dilos.org> Approved by: Garrett D'Amore <garrett@damore.org>
-rw-r--r--usr/src/uts/common/fs/zfs/dbuf.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr/src/uts/common/fs/zfs/dbuf.c b/usr/src/uts/common/fs/zfs/dbuf.c
index e620f9c278..2863c90cd3 100644
--- a/usr/src/uts/common/fs/zfs/dbuf.c
+++ b/usr/src/uts/common/fs/zfs/dbuf.c
@@ -85,10 +85,10 @@ static boolean_t dbuf_evict_thread_exit;
*/
static multilist_t *dbuf_cache;
static refcount_t dbuf_cache_size;
-uint64_t dbuf_cache_max_bytes = 100 * 1024 * 1024;
+uint64_t dbuf_cache_max_bytes = 0;
-/* Cap the size of the dbuf cache to log2 fraction of arc size. */
-int dbuf_cache_max_shift = 5;
+/* Set the default size of the dbuf cache to log2 fraction of arc size. */
+int dbuf_cache_shift = 5;
/*
* The dbuf cache uses a three-stage eviction policy:
@@ -600,11 +600,15 @@ retry:
mutex_init(&h->hash_mutexes[i], NULL, MUTEX_DEFAULT, NULL);
/*
- * Setup the parameters for the dbuf cache. We cap the size of the
- * dbuf cache to 1/32nd (default) of the size of the ARC.
+ * Setup the parameters for the dbuf cache. We set the size of the
+ * dbuf cache to 1/32nd (default) of the size of the ARC. If the value
+ * has been set in /etc/system and it's not greater than the size of
+ * the ARC, then we honor that value.
*/
- dbuf_cache_max_bytes = MIN(dbuf_cache_max_bytes,
- arc_max_bytes() >> dbuf_cache_max_shift);
+ if (dbuf_cache_max_bytes == 0 ||
+ dbuf_cache_max_bytes >= arc_max_bytes()) {
+ dbuf_cache_max_bytes = arc_max_bytes() >> dbuf_cache_shift;
+ }
/*
* All entries are queued via taskq_dispatch_ent(), so min/maxalloc