summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-03-04 13:10:59 +0000
committerattilio <attilio@FreeBSD.org>2013-03-04 13:10:59 +0000
commite5bdd2f06e53c260f9b92776f7f3b1fe5c140dae (patch)
tree44b11994b95bb317cad2c068d227fb777cb3f314 /sys/vm/vm_object.c
parent8374b0e14140d03f8a6128eb532d6ae5f672571b (diff)
downloadFreeBSD-src-e5bdd2f06e53c260f9b92776f7f3b1fe5c140dae.zip
FreeBSD-src-e5bdd2f06e53c260f9b92776f7f3b1fe5c140dae.tar.gz
Merge from vmcontention:
As vm objects are type-stable there is no need to initialize the resident splay tree pointer and the cache splay tree pointer in _vm_object_allocate() but this could be done in the init UMA zone handler. The destructor UMA zone handler, will further check if the condition is retained at every destruction and catch for bugs. Sponsored by: EMC / Isilon storage division Submitted by: alc
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 738cec6..1e588e3 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -165,8 +165,9 @@ vm_object_zdtor(void *mem, int size, void *arg)
object = (vm_object_t)mem;
KASSERT(TAILQ_EMPTY(&object->memq),
- ("object %p has resident pages",
- object));
+ ("object %p has resident pages in its memq", object));
+ KASSERT(object->root == NULL,
+ ("object %p has resident pages in its tree", object));
#if VM_NRESERVLEVEL > 0
KASSERT(LIST_EMPTY(&object->rvq),
("object %p has reservations",
@@ -197,9 +198,11 @@ vm_object_zinit(void *mem, int size, int flags)
mtx_init(&object->mtx, "vm object", NULL, MTX_DEF | MTX_DUPOK);
/* These are true for any object that has been freed */
+ object->root = NULL;
object->paging_in_progress = 0;
object->resident_page_count = 0;
object->shadow_count = 0;
+ object->cache = NULL;
return (0);
}
@@ -210,7 +213,6 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
TAILQ_INIT(&object->memq);
LIST_INIT(&object->shadow_head);
- object->root = NULL;
object->type = type;
switch (type) {
case OBJT_DEAD:
@@ -247,7 +249,6 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
#if VM_NRESERVLEVEL > 0
LIST_INIT(&object->rvq);
#endif
- object->cache = NULL;
mtx_lock(&vm_object_list_mtx);
TAILQ_INSERT_TAIL(&vm_object_list, object, object_list);
OpenPOWER on IntegriCloud