summaryrefslogtreecommitdiffstats
path: root/lib/libmemstat/memstat_internal.h
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2005-07-20 09:17:40 +0000
committerrwatson <rwatson@FreeBSD.org>2005-07-20 09:17:40 +0000
commit7a523e19dbdf32db124098a41f93e706e585050b (patch)
treed3758da9b6587221ae0e6860dda2621e94ec4663 /lib/libmemstat/memstat_internal.h
parentb8e17ef7630a3906fbab49d7daa80ccb9bab26a8 (diff)
downloadFreeBSD-src-7a523e19dbdf32db124098a41f93e706e585050b.zip
FreeBSD-src-7a523e19dbdf32db124098a41f93e706e585050b.tar.gz
UMA supports "secondary" zones, in which a second zone can be layered
on top of a primary zone, sharing the same allocation "keg". When reporting statistics for zones, do not report the free items in the keg as part of the free items in the zone, or those free items will be reported more than once: for the primary zone, and then any secondary zones off the primary zone. Separately record and maintain a kegfree statistic, and export via memstat_get_kegfree(), which is available for use if needed. Since items free'd back to the keg are not fully initialized, and hence may not actually be available (since secondary zone ctor-time initialization can fail), this makes some amount of sense. This change corrects a bug made visible in the libmemstat(3) modifications to netstat: mbufs freed back to the keg from the packet zone would be counted twice, resulting in negative values being printed in the mbuf free count. Some further refinement of reporting relating to secondary zones may still be required. Reported by: ssouhlal MFC after: 3 days
Diffstat (limited to 'lib/libmemstat/memstat_internal.h')
-rw-r--r--lib/libmemstat/memstat_internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libmemstat/memstat_internal.h b/lib/libmemstat/memstat_internal.h
index 1e974df..61eb795 100644
--- a/lib/libmemstat/memstat_internal.h
+++ b/lib/libmemstat/memstat_internal.h
@@ -85,6 +85,7 @@ struct memory_type {
* global stats above.
*/
uint64_t mt_zonefree; /* Free items in zone. */
+ uint64_t mt_kegfree; /* Free items in keg. */
/*
* Per-CPU measurements fall into two categories: per-CPU allocation,
OpenPOWER on IntegriCloud