If a retrieved UMA zone is a secondary zone, don't report keg free items,

as they actually belong to the  primary zone, and maye otherwise be
reported more than once.

MFC after:	1 day
This commit is contained in:
rwatson 2005-07-25 09:52:59 +00:00
parent cdb54d3e8c
commit a2d24671ea

View File

@ -211,7 +211,16 @@ memstat_sysctl_uma(struct memory_type_list *list, int flags)
mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees;
mtp->mt_zonefree = uthp->uth_zone_free;
mtp->mt_kegfree = uthp->uth_keg_free;
/*
* UMA secondary zones share a keg with the primary zone. To
* avoid double-reporting of free items, report keg free
* items only in the primary zone.
*/
if (!(uthp->uth_zone_flags & UTH_ZONE_SECONDARY)) {
mtp->mt_free += mtp->mt_kegfree;
mtp->mt_kegfree = uthp->uth_keg_free;
}
mtp->mt_free += mtp->mt_zonefree;
}