summaryrefslogtreecommitdiffstats
path: root/sys/vm/uma_dbg.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2002-09-18 08:26:30 +0000
committerjeff <jeff@FreeBSD.org>2002-09-18 08:26:30 +0000
commitaeb98331c1a874e05cc0e4d1ab335e18db4fced3 (patch)
treefeefa57915c5e60939c1c6cc8fe31011cf7d6971 /sys/vm/uma_dbg.c
parent705073e549c7036c4006757ad236734705c8778d (diff)
downloadFreeBSD-src-aeb98331c1a874e05cc0e4d1ab335e18db4fced3.zip
FreeBSD-src-aeb98331c1a874e05cc0e4d1ab335e18db4fced3.tar.gz
- Split UMA_ZFLAG_OFFPAGE into UMA_ZFLAG_OFFPAGE and UMA_ZFLAG_HASH.
- Remove all instances of the mallochash. - Stash the slab pointer in the vm page's object pointer when allocating from the kmem_obj. - Use the overloaded object pointer to find slabs for malloced memory.
Diffstat (limited to 'sys/vm/uma_dbg.c')
-rw-r--r--sys/vm/uma_dbg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/vm/uma_dbg.c b/sys/vm/uma_dbg.c
index 729558b..c5ca8c8 100644
--- a/sys/vm/uma_dbg.c
+++ b/sys/vm/uma_dbg.c
@@ -42,6 +42,9 @@
#include <sys/mutex.h>
#include <sys/malloc.h>
+#include <vm/vm.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
#include <vm/uma.h>
#include <vm/uma_int.h>
#include <vm/uma_dbg.h>
@@ -194,10 +197,8 @@ 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) {
+ slab = vtoslab((vm_offset_t)mem);
+ } else if (zone->uz_flags & UMA_ZFLAG_HASH) {
ZONE_LOCK(zone);
slab = hash_sfind(&zone->uz_hash, mem);
ZONE_UNLOCK(zone);
OpenPOWER on IntegriCloud