summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sys/arc.h3
-rw-r--r--module/zfs/dbuf.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/include/sys/arc.h b/include/sys/arc.h
index 0961d4b4d..f88fe0298 100644
--- a/include/sys/arc.h
+++ b/include/sys/arc.h
@@ -51,6 +51,9 @@ typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *private);
typedef void arc_prune_func_t(int64_t bytes, void *private);
typedef int arc_evict_func_t(void *private);
+/* Shared module parameters */
+extern int zfs_arc_average_blocksize;
+
/* generic arc_done_func_t's which you can use */
arc_done_func_t arc_bcopy_func;
arc_done_func_t arc_getbuf_func;
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c
index 3807418c9..bab546c28 100644
--- a/module/zfs/dbuf.c
+++ b/module/zfs/dbuf.c
@@ -376,10 +376,11 @@ dbuf_init(void)
/*
* The hash table is big enough to fill all of physical memory
- * with an average 4K block size. The table will take up
- * totalmem*sizeof(void*)/4K (i.e. 2MB/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 * 4096 < physmem * PAGESIZE)
+ while (hsize * zfs_arc_average_blocksize < physmem * PAGESIZE)
hsize <<= 1;
retry: