summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2009-01-25 09:11:24 +0000
committerjeff <jeff@FreeBSD.org>2009-01-25 09:11:24 +0000
commit69d1bd86702d1d3505e941e98bc5f72403790a22 (patch)
tree816ddb03fae2b243e6596d085b68de89f1198131 /sys/kern/kern_malloc.c
parentce1034ac575d9a536351843e5fa3ac3d26a2a766 (diff)
downloadFreeBSD-src-69d1bd86702d1d3505e941e98bc5f72403790a22.zip
FreeBSD-src-69d1bd86702d1d3505e941e98bc5f72403790a22.tar.gz
- Make the keg abstraction more complete. Permit a zone to have multiple
backend kegs so it may source compatible memory from multiple backends. This is useful for cases such as NUMA or different layouts for the same memory type. - Provide a new api for adding new backend kegs to secondary zones. - Provide a new flag for adjusting the layout of zones to stagger allocations better across cache lines. Sponsored by: Nokia
Diffstat (limited to 'sys/kern/kern_malloc.c')
-rw-r--r--sys/kern/kern_malloc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index 54434e2..02a1e7e 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -329,7 +329,6 @@ malloc(unsigned long size, struct malloc_type *mtp, int flags)
int indx;
caddr_t va;
uma_zone_t zone;
- uma_keg_t keg;
#if defined(DIAGNOSTIC) || defined(DEBUG_REDZONE)
unsigned long osize = size;
#endif
@@ -378,18 +377,16 @@ malloc(unsigned long size, struct malloc_type *mtp, int flags)
size = (size & ~KMEM_ZMASK) + KMEM_ZBASE;
indx = kmemsize[size >> KMEM_ZSHIFT];
zone = kmemzones[indx].kz_zone;
- keg = zone->uz_keg;
#ifdef MALLOC_PROFILE
krequests[size >> KMEM_ZSHIFT]++;
#endif
va = uma_zalloc(zone, flags);
if (va != NULL)
- size = keg->uk_size;
+ size = zone->uz_size;
malloc_type_zone_allocated(mtp, va == NULL ? 0 : size, indx);
} else {
size = roundup(size, PAGE_SIZE);
zone = NULL;
- keg = NULL;
va = uma_large_malloc(size, flags);
malloc_type_allocated(mtp, va == NULL ? 0 : size);
}
OpenPOWER on IntegriCloud