diff options
-rw-r--r-- | sys/vm/uma_core.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index 7eaa8b1..82496e7 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1645,6 +1645,7 @@ uma_zfree_arg(uma_zone_t zone, void *item, void *udata) { uma_cache_t cache; uma_bucket_t bucket; + int bflags; int cpu; /* This is the fast path free */ @@ -1748,12 +1749,16 @@ zfree_start: #ifdef UMA_DEBUG_ALLOC printf("uma_zfree: Allocating new free bucket.\n"); #endif - bucket = uma_zalloc_internal(bucketzone, - NULL, M_NOWAIT, NULL); - if (bucket) { + bflags = M_NOWAIT; + + if (zone->uz_flags & UMA_ZFLAG_BUCKETCACHE) + bflags |= M_NOVM; #ifdef INVARIANTS - bzero(bucket, bucketzone->uz_size); + bflags |= M_ZERO; #endif + bucket = uma_zalloc_internal(bucketzone, + NULL, bflags, NULL); + if (bucket) { bucket->ub_ptr = -1; ZONE_LOCK(zone); LIST_INSERT_HEAD(&zone->uz_free_bucket, |