summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1998-01-17 09:17:02 +0000
committerdyson <dyson@FreeBSD.org>1998-01-17 09:17:02 +0000
commitb130b30c96fd365316e5a4f21ec0965be052e78b (patch)
tree5fa8acd32fec5f8fc8f142f0696ee005c2542f64 /sys/vm/vm_object.c
parentde471d9a3b481d2b4870deedad64835148e99c26 (diff)
downloadFreeBSD-src-b130b30c96fd365316e5a4f21ec0965be052e78b.zip
FreeBSD-src-b130b30c96fd365316e5a4f21ec0965be052e78b.tar.gz
Tie up some loose ends in vnode/object management. Remove an unneeded
config option in pmap. Fix a problem with faulting in pages. Clean-up some loose ends in swap pager memory management. The system should be much more stable, but all subtile bugs aren't fixed yet.
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 33ec0a1..43bf48b 100644
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.c,v 1.105 1998/01/07 03:12:19 dyson Exp $
+ * $Id: vm_object.c,v 1.106 1998/01/12 01:44:38 dyson Exp $
*/
/*
@@ -242,8 +242,11 @@ vm_object_reference(object)
#endif
object->ref_count++;
- if (object->type == OBJT_VNODE)
- vget((struct vnode *) object->handle, LK_NOOBJ, curproc);
+ if (object->type == OBJT_VNODE) {
+ while (vget((struct vnode *) object->handle, LK_RETRY|LK_NOOBJ, curproc)) {
+ printf("vm_object_reference: delay in getting object\n");
+ }
+ }
}
void
@@ -263,11 +266,10 @@ vm_object_vndeallocate(object)
#endif
object->ref_count--;
- if (object->type == OBJT_VNODE) {
- if (object->ref_count == 0)
- vp->v_flag &= ~VTEXT;
- vrele(vp);
+ if (object->ref_count == 0) {
+ vp->v_flag &= ~VTEXT;
}
+ vrele(vp);
}
/*
@@ -296,7 +298,7 @@ vm_object_deallocate(object)
}
if (object->ref_count == 0) {
- panic("vm_object_deallocate: object deallocated too many times");
+ panic("vm_object_deallocate: object deallocated too many times: %d", object->type);
} else if (object->ref_count > 2) {
object->ref_count--;
return;
@@ -452,17 +454,17 @@ vm_object_terminate(object)
*/
vm_pager_deallocate(object);
- simple_lock(&vm_object_list_lock);
- TAILQ_REMOVE(&vm_object_list, object, object_list);
- vm_object_count--;
- simple_unlock(&vm_object_list_lock);
-
- wakeup(object);
-
- /*
- * Free the space for the object.
- */
- zfree(obj_zone, object);
+ if (object->ref_count == 0) {
+ simple_lock(&vm_object_list_lock);
+ TAILQ_REMOVE(&vm_object_list, object, object_list);
+ vm_object_count--;
+ simple_unlock(&vm_object_list_lock);
+ /*
+ * Free the space for the object.
+ */
+ zfree(obj_zone, object);
+ wakeup(object);
+ }
}
/*
OpenPOWER on IntegriCloud