Skip to content

Commit

Permalink
Don't report ghost buffers as evictable mem
Browse files Browse the repository at this point in the history
Ghost meta/data buffers are not actually allocated

AKAMAI: zfs: CR 3695072
Reviewed-by: Tim Chase <tim@chase2k.com>
Reviewed-by: Richard Yao <ryao@gentoo.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Debabrata Banerjee <dbanerje@akamai.com>
Issue #6035
  • Loading branch information
dbavatar authored and behlendorf committed May 2, 2017
1 parent 2b91b51 commit 9b50146
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4374,17 +4374,12 @@ arc_evictable_memory(void)
refcount_count(&arc_mru->arcs_esize[ARC_BUFC_METADATA]) +
refcount_count(&arc_mfu->arcs_esize[ARC_BUFC_DATA]) +
refcount_count(&arc_mfu->arcs_esize[ARC_BUFC_METADATA]);
uint64_t ghost_clean =
refcount_count(&arc_mru_ghost->arcs_esize[ARC_BUFC_DATA]) +
refcount_count(&arc_mru_ghost->arcs_esize[ARC_BUFC_METADATA]) +
refcount_count(&arc_mfu_ghost->arcs_esize[ARC_BUFC_DATA]) +
refcount_count(&arc_mfu_ghost->arcs_esize[ARC_BUFC_METADATA]);
uint64_t arc_dirty = MAX((int64_t)arc_size - (int64_t)arc_clean, 0);

if (arc_dirty >= arc_c_min)
return (ghost_clean + arc_clean);
return (arc_clean);

return (ghost_clean + MAX((int64_t)arc_size - (int64_t)arc_c_min, 0));
return (MAX((int64_t)arc_size - (int64_t)arc_c_min, 0));
}

/*
Expand Down

0 comments on commit 9b50146

Please sign in to comment.