summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-26 23:35:27 +0000
committerattilio <attilio@FreeBSD.org>2013-02-26 23:35:27 +0000
commitcc89d0bd92235897b82b75614fcf8d8f6b33e551 (patch)
tree9899ba247e015337e5b50f08536fdad949aff6ae /sys/vm/vm_object.c
parentfc11335acc0f0255377e8c430cd3dbc31e123d5c (diff)
downloadFreeBSD-src-cc89d0bd92235897b82b75614fcf8d8f6b33e551.zip
FreeBSD-src-cc89d0bd92235897b82b75614fcf8d8f6b33e551.tar.gz
Merge from vmc-playground branch:
Replace the sub-optimal uma_zone_set_obj() primitive with more modern uma_zone_reserve_kva(). The new primitive reserves before hand the necessary KVA space to cater the zone allocations and allocates pages with ALLOC_NOOBJ. More specifically: - uma_zone_reserve_kva() does not need an object to cater the backend allocator. - uma_zone_reserve_kva() can cater M_WAITOK requests, in order to serve zones which need to do uma_prealloc() too. - When possible, uma_zone_reserve_kva() uses directly the direct-mapping by uma_small_alloc() rather than relying on the KVA / offset combination. The removal of the object attribute allows 2 further changes: 1) _vm_object_allocate() becomes static within vm_object.c 2) VM_OBJECT_LOCK_INIT() is removed. This function is replaced by direct calls to mtx_init() as there is no need to export it anymore and the calls aren't either homogeneous anymore: there are now small differences between arguments passed to mtx_init(). Sponsored by: EMC / Isilon storage division Reviewed by: alc (which also offered almost all the comments) Tested by: pho, jhb, davide
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 810707e..28d6d0c 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -194,7 +194,7 @@ vm_object_zinit(void *mem, int size, int flags)
object = (vm_object_t)mem;
bzero(&object->mtx, sizeof(object->mtx));
- VM_OBJECT_LOCK_INIT(object, "standard object");
+ mtx_init(&object->mtx, "vm object", NULL, MTX_DEF | MTX_DUPOK);
/* These are true for any object that has been freed */
object->paging_in_progress = 0;
@@ -203,7 +203,7 @@ vm_object_zinit(void *mem, int size, int flags)
return (0);
}
-void
+static void
_vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
{
@@ -266,7 +266,7 @@ vm_object_init(void)
TAILQ_INIT(&vm_object_list);
mtx_init(&vm_object_list_mtx, "vm object_list", NULL, MTX_DEF);
- VM_OBJECT_LOCK_INIT(kernel_object, "kernel object");
+ mtx_init(&kernel_object->mtx, "vm object", "kernel object", MTX_DEF);
_vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS),
kernel_object);
#if VM_NRESERVLEVEL > 0
@@ -274,7 +274,7 @@ vm_object_init(void)
kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS);
#endif
- VM_OBJECT_LOCK_INIT(kmem_object, "kmem object");
+ mtx_init(&kmem_object->mtx, "vm object", "kmem object", MTX_DEF);
_vm_object_allocate(OBJT_PHYS, OFF_TO_IDX(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS),
kmem_object);
#if VM_NRESERVLEVEL > 0
OpenPOWER on IntegriCloud