None of the "alloc" functions used by UMA assume that Giant is held any

longer.  (If they still need it, e.g., contigmalloc(), they acquire it
themselves.)  Therefore, we need not acquire Giant in slab_zalloc().
This commit is contained in:
Alan Cox 2003-07-28 02:29:07 +00:00
parent 78e0aea5b7
commit 234c7726c8

View File

@ -706,15 +706,8 @@ slab_zalloc(uma_zone_t zone, int wait)
wait &= ~M_ZERO;
if (booted || (zone->uz_flags & UMA_ZFLAG_PRIVALLOC)) {
if ((wait & M_NOWAIT) == 0) {
mtx_lock(&Giant);
mem = zone->uz_allocf(zone,
zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait);
mtx_unlock(&Giant);
} else {
mem = zone->uz_allocf(zone,
zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait);
}
mem = zone->uz_allocf(zone, zone->uz_ppera * UMA_SLAB_SIZE,
&flags, wait);
if (mem == NULL) {
ZONE_LOCK(zone);
return (NULL);