From 9b50146dc444239112610284a0872310701289c4 Mon Sep 17 00:00:00 2001 From: Debabrata Banerjee Date: Sun, 26 Feb 2017 20:32:13 -0500 Subject: [PATCH] Don't report ghost buffers as evictable mem Ghost meta/data buffers are not actually allocated AKAMAI: zfs: CR 3695072 Reviewed-by: Tim Chase Reviewed-by: Richard Yao Reviewed-by: Brian Behlendorf Signed-off-by: Debabrata Banerjee Issue #6035 --- module/zfs/arc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 25fdbdd2b..4e5c9eaf5 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -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)); } /*