summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-04-27 20:07:57 +0000
committeralc <alc@FreeBSD.org>2003-04-27 20:07:57 +0000
commitd1369599aca09a6953b885c1a4ef73d3e06a71f6 (patch)
tree3e0f54ec0f5562563f3a79b5ed3e447347dda803 /sys/vm
parent05ca2866fced60c6ea27ea67b5855d9a48858156 (diff)
downloadFreeBSD-src-d1369599aca09a6953b885c1a4ef73d3e06a71f6.zip
FreeBSD-src-d1369599aca09a6953b885c1a4ef73d3e06a71f6.tar.gz
- Tell witness that holding two or more vm_object locks is okay.
- In vm_object_deallocate(), lock the child when removing the parent from the child's shadow list.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_object.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index a3b31f1..2a79dba 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -193,7 +193,7 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
{
int incr;
- mtx_init(&object->mtx, "vm object", NULL, MTX_DEF);
+ mtx_init(&object->mtx, "vm object", NULL, MTX_DEF | MTX_DUPOK);
TAILQ_INIT(&object->memq);
TAILQ_INIT(&object->shadow_head);
@@ -504,10 +504,12 @@ vm_object_deallocate(vm_object_t object)
doterm:
VM_OBJECT_LOCK(object);
temp = object->backing_object;
- if (temp) {
+ if (temp != NULL) {
+ VM_OBJECT_LOCK(temp);
TAILQ_REMOVE(&temp->shadow_head, object, shadow_list);
temp->shadow_count--;
temp->generation++;
+ VM_OBJECT_UNLOCK(temp);
object->backing_object = NULL;
}
/*
OpenPOWER on IntegriCloud