From 596a8935a140d3238b46d9858de7a727524c2b51 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Tue, 17 Mar 2015 15:04:27 -0700 Subject: Fix arc_meta_max accounting The arc_meta_max value should be increased when space it consumed not when it is returned. This ensure's that arc_meta_max is always up to date. Signed-off-by: Brian Behlendorf Signed-off-by: Pavel Snajdr Issue #3160 --- module/zfs/arc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/zfs') diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 6c625c108..188086767 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -1275,8 +1275,11 @@ arc_space_consume(uint64_t space, arc_space_type_t type) break; } - if (type != ARC_SPACE_DATA) + if (type != ARC_SPACE_DATA) { ARCSTAT_INCR(arcstat_meta_used, space); + if (arc_meta_max < arc_meta_used) + arc_meta_max = arc_meta_used; + } atomic_add_64(&arc_size, space); } @@ -1308,8 +1311,6 @@ arc_space_return(uint64_t space, arc_space_type_t type) if (type != ARC_SPACE_DATA) { ASSERT(arc_meta_used >= space); - if (arc_meta_max < arc_meta_used) - arc_meta_max = arc_meta_used; ARCSTAT_INCR(arcstat_meta_used, -space); } -- cgit v1.2.3