diff options
author | jeff <jeff@FreeBSD.org> | 2013-08-07 06:21:20 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2013-08-07 06:21:20 +0000 |
commit | de4ecca21340ce4d0bf9182cac133c14e031218e (patch) | |
tree | 950bad07f0aeeeae78036d82b9aa11ae998c3654 /sys/cddl/compat | |
parent | e141f5c0bac3839e4886a26e1ba796f4e46e6455 (diff) | |
download | FreeBSD-src-de4ecca21340ce4d0bf9182cac133c14e031218e.zip FreeBSD-src-de4ecca21340ce4d0bf9182cac133c14e031218e.tar.gz |
Replace kernel virtual address space allocation with vmem. This provides
transparent layering and better fragmentation.
- Normalize functions that allocate memory to use kmem_*
- Those that allocate address space are named kva_*
- Those that operate on maps are named kmap_*
- Implement recursive allocation handling for kmem_arena in vmem.
Reviewed by: alc
Tested by: pho
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/cddl/compat')
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c | 4 | ||||
-rw-r--r-- | sys/cddl/compat/opensolaris/sys/kmem.h | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c index 3bcbc0b..543a3a6 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c @@ -62,6 +62,8 @@ static struct mtx kmem_items_mtx; MTX_SYSINIT(kmem_items_mtx, &kmem_items_mtx, "kmem_items", MTX_DEF); #endif /* KMEM_DEBUG */ +#include <sys/vmem.h> + void * zfs_kmem_alloc(size_t size, int kmflags) { @@ -135,7 +137,7 @@ uint64_t kmem_used(void) { - return (kmem_map->size); + return (vmem_size(kmem_arena, VMEM_ALLOC)); } static int diff --git a/sys/cddl/compat/opensolaris/sys/kmem.h b/sys/cddl/compat/opensolaris/sys/kmem.h index ba8b42d..d6179a1 100644 --- a/sys/cddl/compat/opensolaris/sys/kmem.h +++ b/sys/cddl/compat/opensolaris/sys/kmem.h @@ -32,6 +32,7 @@ #include <sys/param.h> #include <sys/proc.h> #include <sys/malloc.h> +#include <sys/vmem.h> #include <vm/uma.h> #include <vm/vm.h> @@ -61,8 +62,6 @@ typedef struct kmem_cache { void *kc_private; } kmem_cache_t; -#define vmem_t void - void *zfs_kmem_alloc(size_t size, int kmflags); void zfs_kmem_free(void *buf, size_t size); uint64_t kmem_size(void); |