Skip to content

Commit

Permalink
5034 ARC's buf_hash_table is too small
Browse files Browse the repository at this point in the history
Reviewed by: Christopher Siden <christopher.siden@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
Reviewed by: Richard Elling <richard.elling@gmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
  • Loading branch information
ahrens authored and Christopher Siden committed Jul 28, 2014
1 parent 0f6d88a commit 63e911b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions usr/src/uts/common/fs/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,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;
int zfs_arc_average_blocksize = 8 * 1024; /* 8KB */

/*
* Note that buffers can be in one of 6 states:
Expand Down Expand Up @@ -938,10 +939,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 < physmem * PAGESIZE)
while (hsize * zfs_arc_average_blocksize < physmem * PAGESIZE)
hsize <<= 1;
retry:
buf_hash_table.ht_mask = hsize - 1;
Expand Down

0 comments on commit 63e911b

Please sign in to comment.