summaryrefslogtreecommitdiffstats
path: root/sys/vm/uma_dbg.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-05-02 07:22:19 +0000
committerjeff <jeff@FreeBSD.org>2002-05-02 07:22:19 +0000
commitf7f01600de16995a3b8291a1e6f854e750acf936 (patch)
tree86482f4b8dccbe22cf90e0bb2b1bf7a864a50fd7 /sys/vm/uma_dbg.c
parent56adfc1b2546af8bfccfe47c0ed4a5f3bc706be6 (diff)
downloadFreeBSD-src-f7f01600de16995a3b8291a1e6f854e750acf936.zip
FreeBSD-src-f7f01600de16995a3b8291a1e6f854e750acf936.tar.gz
malloc/free(9) no longer require Giant. Use the malloc_mtx to protect the
mallochash. Mallochash is going to go away as soon as I introduce the kfree/kmalloc api and partially overhaul the malloc wrapper. This can't happen until all users of the malloc api that expect memory to be aligned on the size of the allocation are fixed.
Diffstat (limited to 'sys/vm/uma_dbg.c')
-rw-r--r--sys/vm/uma_dbg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/vm/uma_dbg.c b/sys/vm/uma_dbg.c
index 2e5c894..0e71c6c 100644
--- a/sys/vm/uma_dbg.c
+++ b/sys/vm/uma_dbg.c
@@ -119,7 +119,9 @@ uma_dbg_getslab(uma_zone_t zone, void *item)
mem = (u_int8_t *)((unsigned long)item & (~UMA_SLAB_MASK));
if (zone->uz_flags & UMA_ZFLAG_MALLOC) {
+ mtx_lock(&malloc_mtx);
slab = hash_sfind(mallochash, mem);
+ mtx_unlock(&malloc_mtx);
} else if (zone->uz_flags & UMA_ZFLAG_OFFPAGE) {
ZONE_LOCK(zone);
slab = hash_sfind(&zone->uz_hash, mem);
OpenPOWER on IntegriCloud