diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-01-10 21:04:43 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-01-10 21:04:43 +0000 |
commit | d6f9a991c6690168c2012037cb4e71840917f2a6 (patch) | |
tree | 16895192cda9395f5193a70e0d279b2c5e1f5c24 /sys/vm | |
parent | 94096b5616651962420bac2b59785836587538b4 (diff) | |
download | FreeBSD-src-d6f9a991c6690168c2012037cb4e71840917f2a6.zip FreeBSD-src-d6f9a991c6690168c2012037cb4e71840917f2a6.tar.gz |
Remove uma_zalloc_arg() hack, which coerced M_WAITOK to M_NOWAIT when
allocations were made using improper flags in interrupt context.
Replace with a simple WITNESS warning call. This restores the
invariant that M_WAITOK allocations will always succeed or die
horribly trying, which is relied on by many UMA consumers.
MFC after: 3 weeks
Discussed with: jhb
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/uma_core.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index ac3ffc4..0bdcd2f 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -1772,7 +1772,6 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) uma_cache_t cache; uma_bucket_t bucket; int cpu; - int badness; /* This is the fast path allocation */ #ifdef UMA_DEBUG_ALLOC_1 @@ -1781,27 +1780,9 @@ uma_zalloc_arg(uma_zone_t zone, void *udata, int flags) CTR3(KTR_UMA, "uma_zalloc_arg thread %x zone %s flags %d", curthread, zone->uz_name, flags); - if (!(flags & M_NOWAIT)) { - KASSERT(curthread->td_intr_nesting_level == 0, - ("malloc(M_WAITOK) in interrupt context")); - if (nosleepwithlocks) { -#ifdef WITNESS - badness = WITNESS_CHECK(WARN_GIANTOK | WARN_SLEEPOK, - NULL, - "malloc(M_WAITOK) of \"%s\", forcing M_NOWAIT", - zone->uz_name); -#else - badness = 1; -#endif - } else { - badness = 0; - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "malloc(M_WAITOK) of \"%s\"", zone->uz_name); - } - if (badness) { - flags &= ~M_WAITOK; - flags |= M_NOWAIT; - } + if (flags & M_WAITOK) { + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "uma_zalloc_arg: zone \"%s\"", zone->uz_name); } /* |