aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/malloc.h
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2018-01-12 23:25:05 +0000
committerJeff Roberson <jeff@FreeBSD.org>2018-01-12 23:25:05 +0000
commitab3185d15ef8958b3a60325620460229f4ae07ce (patch)
tree170808c5b9dd499f9062138d282fffcacd3426d8 /sys/sys/malloc.h
parent7a469c8ef3e80ae04f3055789c316e4816880f28 (diff)
downloadsrc-ab3185d15ef8958b3a60325620460229f4ae07ce.tar.gz
src-ab3185d15ef8958b3a60325620460229f4ae07ce.zip
Implement NUMA support in uma(9) and malloc(9). Allocations from specific
domains can be done by the _domain() API variants. UMA also supports a first-touch policy via the NUMA zone flag. The slab layer is now segregated by VM domains and is precise. It handles iteration for round-robin directly. The per-cpu cache layer remains a mix of domains according to where memory is allocated and freed. Well behaved clients can achieve perfect locality with no performance penalty. The direct domain allocation functions have to visit the slab layer and so require per-zone locks which come at some expense. Reviewed by: Attilio (a slightly older version) Tested by: pho Sponsored by: Netflix, Dell/EMC Isilon
Notes
Notes: svn path=/head/; revision=327900
Diffstat (limited to 'sys/sys/malloc.h')
-rw-r--r--sys/sys/malloc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index 47ca13f5ebd6..57a06e8ccfd4 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -175,9 +175,17 @@ void *contigmalloc(unsigned long size, struct malloc_type *type, int flags,
vm_paddr_t low, vm_paddr_t high, unsigned long alignment,
vm_paddr_t boundary) __malloc_like __result_use_check
__alloc_size(1) __alloc_align(6);
+void *contigmalloc_domain(unsigned long size, struct malloc_type *type,
+ int domain, int flags, vm_paddr_t low, vm_paddr_t high,
+ unsigned long alignment, vm_paddr_t boundary)
+ __malloc_like __result_use_check __alloc_size(1) __alloc_align(6);
void free(void *addr, struct malloc_type *type);
+void free_domain(void *addr, struct malloc_type *type);
void *malloc(unsigned long size, struct malloc_type *type, int flags)
__malloc_like __result_use_check __alloc_size(1);
+void *malloc_domain(unsigned long size, struct malloc_type *type,
+ int domain, int flags)
+ __malloc_like __result_use_check __alloc_size(1);
void *mallocarray(size_t nmemb, size_t size, struct malloc_type *type,
int flags) __malloc_like __result_use_check
__alloc_size(1) __alloc_size(2);