]> git.proxmox.com Git - mirror_zfs.git/commit
Fix arc_adjust_meta() behavior
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 17 Mar 2015 22:08:22 +0000 (15:08 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 20 Mar 2015 17:35:20 +0000 (10:35 -0700)
commitbc88866657979c5658441e201e19df365c67ddfe
tree2725fb8c50d648642b2d3a9f10b0114aeb8aff0b
parent2cbb06b561f500732de2214eb590149d0c4f3cf5
Fix arc_adjust_meta() behavior

The goal of this function is to evict enough meta data buffers from the
ARC in order to enforce the arc_meta_limit.  Achieving this is slightly
more complicated than it appears because it is common for data buffers
to have holds on meta data buffers.  In addition, dnode meta data buffers
will be held by the dnodes in the block preventing them from being freed.
This means we can't simply traverse the ARC and expect to always find
enough unheld meta data buffer to release.

Therefore, this function has been updated to make alternating passes
over the ARC releasing data buffers and then newly unheld meta data
buffers.  This ensures forward progress is maintained and arc_meta_used
will decrease.  Normally this is sufficient, but if required the ARC
will call the registered prune callbacks causing dentry and inodes to
be dropped from the VFS cache.  This will make dnode meta data buffers
available for reclaim.  The number of total restarts in limited by
zfs_arc_meta_adjust_restarts to prevent spinning in the rare case
where all meta data is pinned.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Issue #3160
man/man5/zfs-module-parameters.5
module/zfs/arc.c