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 <behlendorf1@llnl.gov>
Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
Issue #3160
This commit is contained in:
Brian Behlendorf 2015-03-17 15:04:27 -07:00
parent 5c3f61eb49
commit 596a8935a1

View File

@ -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);
}