In an earlier world order, UMA would flush per-CPU statistics to the

zone whenever it was moving buckets between the zone and the cache,
or when coalescing statistics across the CPU.  Remove flushing of
statistics to the zone when coalescing statistics as part of sysctl,
as we won't be running on the right CPU to write to the cache
statistics.

Add a missed gathering of statistics: when uma_zalloc_internal()
does a special case allocation of a single item, make sure to update
the zone statistics to represent this.  Previously this case wasn't
accounted for in user-visible statistics.

MFC after:	1 week
This commit is contained in:
rwatson 2005-07-14 16:13:46 +00:00
parent 07353f37ea
commit 3f3682a4b8

View File

@ -2203,6 +2203,8 @@ uma_zalloc_internal(uma_zone_t zone, void *udata, int flags)
item = uma_slab_alloc(zone, slab);
zone->uz_allocs++;
ZONE_UNLOCK(zone);
/*
@ -2799,7 +2801,6 @@ sysctl_vm_zone(SYSCTL_HANDLER_ARGS)
if (cache->uc_freebucket != NULL)
cachefree += cache->uc_freebucket->ub_cnt;
alloc += cache->uc_allocs;
cache->uc_allocs = 0;
}
}
alloc += z->uz_allocs;