From 12289fcebc849f6eda9d53961cd2088c39310599 Mon Sep 17 00:00:00 2001 From: attilio Date: Sun, 24 Feb 2013 16:41:36 +0000 Subject: 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 --- sys/vm/vm_radix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sys/vm/vm_radix.c') 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); -- cgit v1.1