HomeFreeBSD

Allow arc_evict_ghost() to only evict meta data

Description

Allow arc_evict_ghost() to only evict meta data

The default behavior of arc_evict_ghost() is to start by evicting
data buffers. Then only if the requested number of bytes to evict
cannot be satisfied by data buffers move on to meta data buffers.

This is ideal for honoring arc_c since it's preferable to keep the
meta data cached. However, if we're trying to free memory from the
arc to honor the meta limit it's a problem because we will need to
discard all the data to get to the meta data.

To avoid this issue the arc_evict_ghost() is now passed a fourth
argumented describing which buffer type to start with. The
arc_evict() function already behaves exactly like this for a
same reason so this is consistent with the existing code.

All existing callers have been updated to pass ARC_BUFC_DATA so
this patch introduces no functional change. New callers may
pass ARC_BUFC_METADATA to skip immediately to evicting meta
data leaving the normal data untouched.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jul 25 2013, 5:28 PM
Parents
rG4e59f475118b: Illumos #3964 L2ARC should always compress metadata buffers
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG68121a03daf5: Allow arc_evict_ghost() to only evict meta data (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Aug 9 2013, 5:06 PM