summaryrefslogtreecommitdiffstats
path: root/lib/libmemstat
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-07-25 09:52:59 +0000
committerrwatson <rwatson@FreeBSD.org>2005-07-25 09:52:59 +0000
commita2d24671eab600f642f4ff91d05a29f9cc8de794 (patch)
tree1b03d4fcca176d2414a0cf8d9d493d4da9715b0f /lib/libmemstat
parentcdb54d3e8cb1dd21faa3d1ad5d1847dd01df368f (diff)
downloadFreeBSD-src-a2d24671eab600f642f4ff91d05a29f9cc8de794.zip
FreeBSD-src-a2d24671eab600f642f4ff91d05a29f9cc8de794.tar.gz
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
Diffstat (limited to 'lib/libmemstat')
-rw-r--r--lib/libmemstat/memstat_uma.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c
index b35c4d9..6d5407c 100644
--- a/lib/libmemstat/memstat_uma.c
+++ b/lib/libmemstat/memstat_uma.c
@@ -211,7 +211,16 @@ retry:
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;
}
OpenPOWER on IntegriCloud