diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-07-14 20:01:04 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-07-14 20:01:04 +0000 |
commit | fc39b92b3793131311838fd90a4793aec7c942f7 (patch) | |
tree | 0ad5b0374d904ef6d1b0d0a8183021b982baabdf /lib | |
parent | 551446f627af0ed3afc5f879cb5cc40b2c02bd94 (diff) | |
download | FreeBSD-src-fc39b92b3793131311838fd90a4793aec7c942f7.zip FreeBSD-src-fc39b92b3793131311838fd90a4793aec7c942f7.tar.gz |
Properly combine per-CPU UMA cache allocation and free counts with the
global counters maintained in the zone.
MFC after: 1 week
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libmemstat/memstat_uma.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libmemstat/memstat_uma.c b/lib/libmemstat/memstat_uma.c index 21e3989..1fc98f5 100644 --- a/lib/libmemstat/memstat_uma.c +++ b/lib/libmemstat/memstat_uma.c @@ -199,6 +199,9 @@ retry: */ memstat_mt_reset_stats(mtp); + mtp->mt_numallocs = uthp->uth_allocs; + mtp->mt_numfrees = uthp->uth_frees; + for (j = 0; j < maxcpus; j++) { upsp = (struct uma_percpu_stat *)p; p += sizeof(*upsp); @@ -211,14 +214,12 @@ retry: } mtp->mt_size = uthp->uth_size; - mtp->mt_memalloced = uthp->uth_allocs * uthp->uth_size; - mtp->mt_memfreed = uthp->uth_frees * uthp->uth_size; + mtp->mt_memalloced = mtp->mt_numallocs * uthp->uth_size; + mtp->mt_memfreed = mtp->mt_numfrees * uthp->uth_size; mtp->mt_bytes = mtp->mt_memalloced - mtp->mt_memfreed; mtp->mt_countlimit = uthp->uth_limit; mtp->mt_byteslimit = uthp->uth_limit * uthp->uth_size; - mtp->mt_numallocs = uthp->uth_allocs; - mtp->mt_numfrees = uthp->uth_frees; mtp->mt_count = mtp->mt_numallocs - mtp->mt_numfrees; mtp->mt_zonefree = uthp->uth_zone_free + uthp->uth_keg_free; mtp->mt_free += mtp->mt_zonefree; |