]> git.proxmox.com Git - mirror_zfs.git/commit
Scale the dbuf cache with arc_c
authorchrisrd <chris@onthe.net.au>
Fri, 29 Sep 2017 22:49:19 +0000 (08:49 +1000)
committerTony Hutter <hutter2@llnl.gov>
Mon, 16 Oct 2017 17:57:54 +0000 (10:57 -0700)
commit25d232f40713604dec1f6f6ef68802ab58115af0
tree7d231915f590b480136e7b64d5b30380078dbdef
parentedd7c24623529095bce10cb7ff3a8c3800c0067c
Scale the dbuf cache with arc_c

Commit d3c2ae1 introduced a dbuf cache with a default size of the
minimum of 100M or 1/32 maximum ARC size. (These figures may be adjusted
using dbuf_cache_max_bytes and dbuf_cache_max_shift.) The dbuf cache
is counted as metadata for the purposes of ARC size calculations.

On a 1GB box the ARC maximum size defaults to c_max 493M which gives a
dbuf cache default minimum size of 15.4M, and the ARC metadata defaults
to minimum 16M. I.e. the dbuf cache is an significant proportion of the
minimum metadata size. With other overheads involved this actually means
the ARC metadata doesn't get down to the minimum.

This patch dynamically scales the dbuf cache to the target ARC size
instead of statically scaling it to the maximum ARC size. (The scale is
still set by dbuf_cache_max_shift and the maximum size is still fixed by
dbuf_cache_max_bytes.) Using the target ARC size rather than the current
ARC size is done to help the ARC reach the target rather than simply
focusing on the current size.

Reviewed-by: Chunwei Chen <tuxoko@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Chris Dunlop <chris@onthe.net.au>
Issue #6506
Closes #6561
include/sys/arc.h
module/zfs/arc.c
module/zfs/dbuf.c