From b31d8ea77cd91dce29acf3ec448180f3715cca13 Mon Sep 17 00:00:00 2001 From: Chris Wedgwood Date: Thu, 23 Oct 2014 16:00:41 -0700 Subject: [PATCH] Reduce buf/dbuf mutex contention Due to evidence of contention both the buf_hash_table and the dbuf_hash_table sizes have been increased from 256 to 8192. This increase in hash table size adds approximating 0.5M to our fixed memory footprint. This relatively small increase is not expected to cause problems even on low memory machines. This footprint will also become dynamic when the persistent L2ARC support is finalized. In the meanwhile, this small change significantly reduces contention for certain workloads. Signed-off-by: Chris Wedgwood Signed-off-by: Brian Behlendorf Signed-off-by: Pavel Snajdr Closes #1291 --- include/sys/dbuf.h | 2 +- module/zfs/arc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/sys/dbuf.h b/include/sys/dbuf.h index 76daea90e9b..af509ca388f 100644 --- a/include/sys/dbuf.h +++ b/include/sys/dbuf.h @@ -233,7 +233,7 @@ typedef struct dmu_buf_impl { } dmu_buf_impl_t; /* Note: the dbuf hash table is exposed only for the mdb module */ -#define DBUF_MUTEXES 256 +#define DBUF_MUTEXES 8192 #define DBUF_HASH_MUTEX(h, idx) (&(h)->hash_mutexes[(idx) & (DBUF_MUTEXES-1)]) typedef struct dbuf_hash_table { uint64_t hash_table_mask; diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 4cb77327959..0742da0f6f4 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -657,7 +657,7 @@ struct ht_lock { #endif }; -#define BUF_LOCKS 256 +#define BUF_LOCKS 8192 typedef struct buf_hash_table { uint64_t ht_mask; arc_buf_hdr_t **ht_table;