summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1998-02-25 03:56:15 +0000
committerdyson <dyson@FreeBSD.org>1998-02-25 03:56:15 +0000
commit014146c040ed6640e606b46e58c066fc3a1c442c (patch)
tree58ba9b01b799e946135e458cf791510488f813df /sys/vm/vm_object.c
parentff694902b34f411a83d04c782b9310e79c3701e9 (diff)
downloadFreeBSD-src-014146c040ed6640e606b46e58c066fc3a1c442c.zip
FreeBSD-src-014146c040ed6640e606b46e58c066fc3a1c442c.tar.gz
Fix page prezeroing for SMP, and fix some potential paging-in-progress
hangs. The paging-in-progress diagnosis was a result of Tor Egge's excellent detective work. Submitted by: Partially from Tor Egge.
Diffstat (limited to 'sys/vm/vm_object.c')
-rw-r--r--sys/vm/vm_object.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 22b3f7a..ad339d4 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.112 1998/02/06 12:14:26 eivind Exp $
+ * $Id: vm_object.c,v 1.113 1998/02/09 06:11:30 eivind Exp $
*/
/*
@@ -334,21 +334,23 @@ vm_object_deallocate(object)
robject->ref_count++;
retry:
- s = splvm();
- if (robject->paging_in_progress) {
- robject->flags |= OBJ_PIPWNT;
- tsleep(robject, PVM, "objde1", 0);
- splx(s);
- goto retry;
- }
-
- if (object->paging_in_progress) {
- object->flags |= OBJ_PIPWNT;
- tsleep(object, PVM, "objde2", 0);
- splx(s);
+ if (robject->paging_in_progress || object->paging_in_progress) {
+ vm_object_pip_sleep(robject, "objde1");
+ if (robject->paging_in_progress) {
+ if (robject->type == OBJT_SWAP) {
+ swap_pager_sync();
+ goto retry;
+ }
+ }
+
+ vm_object_pip_sleep(object, "objde2");
+ if (object->paging_in_progress) {
+ if (object->type == OBJT_SWAP) {
+ swap_pager_sync();
+ }
+ }
goto retry;
}
- splx(s);
if( robject->ref_count == 1) {
robject->ref_count--;
@@ -408,12 +410,7 @@ vm_object_terminate(object)
/*
* wait for the pageout daemon to be done with the object
*/
- s = splvm();
- while (object->paging_in_progress) {
- object->flags |= OBJ_PIPWNT;
- tsleep(object, PVM, "objtrm", 0);
- }
- splx(s);
+ vm_object_pip_wait(object, "objtrm");
#if defined(DIAGNOSTIC)
if (object->paging_in_progress != 0)
OpenPOWER on IntegriCloud