uma: whack main zone counter update in the slow path

Cached counters are typically zero at this point so it performs
avoidable atomics. Everything reading them also reads the cached
ones, thus there is really no point.

Reviewed by:		jeff
This commit is contained in:
mjg 2018-04-27 05:37:35 +00:00
parent 5fdcfd6ee4
commit 2ae63d9ae0

View File

@ -2329,14 +2329,6 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags)
cpu = curcpu;
cache = &zone->uz_cpu[cpu];
/*
* Since we have locked the zone we may as well send back our stats.
*/
atomic_add_long(&zone->uz_allocs, cache->uc_allocs);
atomic_add_long(&zone->uz_frees, cache->uc_frees);
cache->uc_allocs = 0;
cache->uc_frees = 0;
/* See if we lost the race to fill the cache. */
if (cache->uc_allocbucket != NULL) {
ZONE_UNLOCK(zone);