From e3a9e1b2a86d3526340211f86f886ea7d29af4f2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 29 Dec 2002 21:01:14 +0000 Subject: [PATCH] - Remove vm_object_init2(). It is unused. - Add a mtx_destroy() to vm_object_collapse(). (This allows a bzero() to migrate from _vm_object_allocate() to vm_object_zinit(), where it will be performed less often.) --- sys/vm/vm_map.c | 1 - sys/vm/vm_object.c | 9 +++------ sys/vm/vm_object.h | 1 - 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index d51bd2d9399d..179c0e00952d 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -275,7 +275,6 @@ vm_init2(void) #endif vmspace_zinit, vmspace_zfini, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); pmap_init2(); - vm_object_init2(); } static __inline void diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 5ccf4a6baba8..ae26d19f0f1c 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -180,6 +180,7 @@ vm_object_zinit(void *mem, int size) vm_object_t object; object = (vm_object_t)mem; + bzero(&object->mtx, sizeof(object->mtx)); /* These are true for any object that has been freed */ object->paging_in_progress = 0; @@ -192,7 +193,6 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object) { int incr; - bzero(&object->mtx, sizeof(object->mtx)); mtx_init(&object->mtx, "vm object", NULL, MTX_DEF); TAILQ_INIT(&object->memq); @@ -252,11 +252,6 @@ vm_object_init(void) uma_prealloc(obj_zone, VM_OBJECTS_INIT); } -void -vm_object_init2(void) -{ -} - void vm_object_set_flag(vm_object_t object, u_short bits) { @@ -1630,6 +1625,8 @@ vm_object_collapse(vm_object_t object) ); mtx_unlock(&vm_object_list_mtx); + mtx_destroy(&backing_object->mtx); + uma_zfree(obj_zone, backing_object); object_collapses++; diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index 37a547248ec3..595e78170862 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -207,7 +207,6 @@ void vm_object_reference (vm_object_t); void vm_object_shadow (vm_object_t *, vm_ooffset_t *, vm_size_t); void vm_object_split(vm_map_entry_t); void vm_object_madvise (vm_object_t, vm_pindex_t, int, int); -void vm_object_init2 (void); #endif /* _KERNEL */ #endif /* _VM_OBJECT_ */