diff options
author | attilio <attilio@FreeBSD.org> | 2013-02-24 16:41:36 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2013-02-24 16:41:36 +0000 |
commit | 12289fcebc849f6eda9d53961cd2088c39310599 (patch) | |
tree | 7047ab7ee00ab2136a9fcd785a9ad30af0de326f /sys/vm/vm_radix.c | |
parent | 6b1291b4d1f698048c27a58ed4ac41557801cf6d (diff) | |
download | FreeBSD-src-12289fcebc849f6eda9d53961cd2088c39310599.zip FreeBSD-src-12289fcebc849f6eda9d53961cd2088c39310599.tar.gz |
Retire the old UMA primitive uma_zone_set_obj() and replace it with the
more modern uma_zone_reserve_kva(). The difference is that it doesn't
rely anymore on an obj to allocate pages and the slab allocator doesn't
use any more any specific locking but atomic operations to complete
the operation.
Where possible, the uma_small_alloc() is instead used and the uk_kva
member becomes unused.
The subsequent cleanups also brings along the removal of
VM_OBJECT_LOCK_INIT() macro which is not used anymore as the code
can be easilly cleaned up to perform a single mtx_init(), private
to vm_object.c.
For the same reason, _vm_object_allocate() becomes private as well.
Sponsored by: EMC / Isilon storage division
Reviewed by: alc
Diffstat (limited to 'sys/vm/vm_radix.c')
-rw-r--r-- | sys/vm/vm_radix.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/vm/vm_radix.c b/sys/vm/vm_radix.c index 8a7fb01..41afed8 100644 --- a/sys/vm/vm_radix.c +++ b/sys/vm/vm_radix.c @@ -63,7 +63,7 @@ #endif #ifndef VM_RADIX_BOOT_CACHE -#define VM_RADIX_BOOT_CACHE 1500 +#define VM_RADIX_BOOT_CACHE 150 #endif /* @@ -373,7 +373,6 @@ vm_radix_node_zone_dtor(void *mem, int size __unused, void *arg __unused) static void vm_radix_init(void *arg __unused) { - int nitems; vm_radix_node_zone = uma_zcreate("RADIX NODE", sizeof(struct vm_radix_node), NULL, @@ -383,10 +382,9 @@ vm_radix_init(void *arg __unused) NULL, #endif NULL, NULL, VM_RADIX_PAD, UMA_ZONE_VM | UMA_ZONE_NOFREE); - nitems = uma_zone_set_max(vm_radix_node_zone, cnt.v_page_count); - if (nitems < cnt.v_page_count) - panic("%s: unexpected requested number of items", __func__); - uma_prealloc(vm_radix_node_zone, nitems); + if (!uma_zone_reserve_kva(vm_radix_node_zone, cnt.v_page_count)) + panic("%s: unable to create new zone", __func__); + uma_prealloc(vm_radix_node_zone, cnt.v_page_count); boot_cache_cnt = VM_RADIX_BOOT_CACHE + 1; } SYSINIT(vm_radix_init, SI_SUB_KMEM, SI_ORDER_SECOND, vm_radix_init, NULL); |