Properly combine per-CPU UMA cache allocation and free counts with the

global counters maintained in the zone.

MFC after:	1 week
This commit is contained in:
Robert Watson 2005-07-14 20:01:04 +00:00
parent 3e709972e1
commit 37b40e499e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148007

View file

@ -199,6 +199,9 @@ memstat_sysctl_uma(struct memory_type_list *list, int flags)
*/
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 @@ memstat_sysctl_uma(struct memory_type_list *list, int flags)
}
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;