diff options
author | gallatin <gallatin@FreeBSD.org> | 2003-04-18 13:02:29 +0000 |
---|---|---|
committer | gallatin <gallatin@FreeBSD.org> | 2003-04-18 13:02:29 +0000 |
commit | e2c2f3b86293be44009838be94c2f3aaf23b0a1d (patch) | |
tree | 3b0da33f2d3c09105fda37827318e874a44e800c | |
parent | 194f63b268763c8a66681f9a25a5f0849e5daba7 (diff) | |
download | FreeBSD-src-e2c2f3b86293be44009838be94c2f3aaf23b0a1d.zip FreeBSD-src-e2c2f3b86293be44009838be94c2f3aaf23b0a1d.tar.gz |
Don't grab Giant in slab_zalloc() if M_NOWAIT is specified. This
should allow the use of INTR_MPSAFE network drivers.
Tested by: njl
Glanced at by: jeff
-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 09f3d67..08811a7 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -703,10 +703,15 @@ slab_zalloc(uma_zone_t zone, int wait) wait &= ~M_ZERO; if (booted || (zone->uz_flags & UMA_ZFLAG_PRIVALLOC)) { - mtx_lock(&Giant); - mem = zone->uz_allocf(zone, - zone->uz_ppera * UMA_SLAB_SIZE, &flags, wait); - mtx_unlock(&Giant); + 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); + } if (mem == NULL) { ZONE_LOCK(zone); return (NULL); |