aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2015-03-17 15:04:27 -0700
committerBrian Behlendorf <[email protected]>2015-03-20 10:35:20 -0700
commit596a8935a140d3238b46d9858de7a727524c2b51 (patch)
treefd5ab6c0bd753963337bca48a73d1bb3d5b59e60 /module/zfs
parent5c3f61eb498e8124858b1369096bf64b86a938e7 (diff)
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 <[email protected]> Signed-off-by: Pavel Snajdr <[email protected]> Issue #3160
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/arc.c7
1 files changed, 4 insertions, 3 deletions
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);
}