summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/vm/swap_pager.c8
-rw-r--r--sys/vm/vm_fault.c32
-rw-r--r--sys/vm/vm_object.c34
-rw-r--r--sys/vm/vm_object.h3
-rw-r--r--sys/vm/vm_pageout.c7
-rw-r--r--sys/vm/vnode_pager.c8
6 files changed, 70 insertions, 22 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 66cc7f9..83f159b 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -39,7 +39,7 @@
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
*
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
- * $Id: swap_pager.c,v 1.25 1995/02/02 09:08:00 davidg Exp $
+ * $Id: swap_pager.c,v 1.26 1995/02/21 01:22:44 davidg Exp $
*/
/*
@@ -1608,8 +1608,12 @@ swap_pager_finish(spc)
vm_object_t object = spc->spc_m[0]->object;
int i;
- if ((object->paging_in_progress -= spc->spc_count) == 0)
+ object->paging_in_progress -= spc->spc_count;
+ if ((object->paging_in_progress == 0) &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
thread_wakeup((int) object);
+ }
/*
* If no error mark as clean and inform the pmap system. If error,
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 1e0b426..87788a7 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -66,7 +66,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_fault.c,v 1.17 1995/01/26 01:40:04 davidg Exp $
+ * $Id: vm_fault.c,v 1.18 1995/02/02 09:08:17 davidg Exp $
*/
/*
@@ -165,15 +165,21 @@ vm_fault(map, vaddr, fault_type, change_wiring)
#define UNLOCK_THINGS { \
object->paging_in_progress--; \
- if (object->paging_in_progress == 0) \
+ if ((object->paging_in_progress == 0) && \
+ (object->flags & OBJ_PIPWNT)) { \
+ object->flags &= ~OBJ_PIPWNT; \
wakeup((caddr_t)object); \
+ } \
vm_object_unlock(object); \
if (object != first_object) { \
vm_object_lock(first_object); \
FREE_PAGE(first_m); \
first_object->paging_in_progress--; \
- if (first_object->paging_in_progress == 0) \
+ if ((first_object->paging_in_progress == 0) && \
+ (first_object->flags & OBJ_PIPWNT)) { \
+ first_object->flags &= ~OBJ_PIPWNT; \
wakeup((caddr_t)first_object); \
+ } \
vm_object_unlock(first_object); \
} \
UNLOCK_MAP; \
@@ -441,8 +447,11 @@ readrest:
*/
if (object != first_object) {
object->paging_in_progress--;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
vm_object_unlock(object);
object = first_object;
@@ -460,8 +469,11 @@ readrest:
vm_object_lock(next_object);
if (object != first_object) {
object->paging_in_progress--;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
}
vm_object_unlock(object);
object = next_object;
@@ -539,8 +551,11 @@ readrest:
*/
PAGE_WAKEUP(m);
object->paging_in_progress--;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
vm_object_unlock(object);
/*
@@ -562,8 +577,11 @@ readrest:
* paging_in_progress to do that...
*/
object->paging_in_progress--;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
vm_object_collapse(object);
object->paging_in_progress++;
} else {
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
index 811ce15..aa90087 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.24 1995/02/20 14:21:58 davidg Exp $
+ * $Id: vm_object.c,v 1.25 1995/02/21 01:22:47 davidg Exp $
*/
/*
@@ -270,11 +270,13 @@ vm_object_deallocate(object)
do {
s = splhigh();
- while( robject->paging_in_progress) {
+ while (robject->paging_in_progress) {
+ robject->flags |= OBJ_PIPWNT;
tsleep(robject, PVM, "objde1", 0);
}
- while( object->paging_in_progress) {
+ while (object->paging_in_progress) {
+ object->flags |= OBJ_PIPWNT;
tsleep(object, PVM, "objde2", 0);
}
splx(s);
@@ -379,6 +381,7 @@ vm_object_terminate(object)
s = splhigh();
while (object->paging_in_progress) {
vm_object_unlock(object);
+ object->flags |= OBJ_PIPWNT;
tsleep((caddr_t) object, PVM, "objtrm", 0);
vm_object_lock(object);
}
@@ -494,6 +497,7 @@ again:
* Wait until the pageout daemon is through with the object.
*/
while (object->paging_in_progress) {
+ object->flags |= OBJ_PIPWNT;
tsleep(object, PVM, "objpcw", 0);
}
@@ -776,8 +780,10 @@ again:
}
vm_object_unlock(object);
--object->paging_in_progress;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 && (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
}
/*
@@ -1406,8 +1412,11 @@ vm_object_collapse(object)
object->pager, object->paging_offset,
object->shadow_offset);
object->paging_in_progress--;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
} else {
object->paging_in_progress++;
/*
@@ -1422,12 +1431,19 @@ vm_object_collapse(object)
*/
swap_pager_freespace(object->pager, 0, object->paging_offset);
object->paging_in_progress--;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
}
+
backing_object->paging_in_progress--;
- if (backing_object->paging_in_progress == 0)
+ if (backing_object->paging_in_progress == 0 &&
+ (backing_object->flags & OBJ_PIPWNT)) {
+ backing_object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) backing_object);
+ }
}
/*
* Object now shadows whatever backing_object did.
@@ -1630,8 +1646,10 @@ again:
}
}
--object->paging_in_progress;
- if (object->paging_in_progress == 0)
+ if (object->paging_in_progress == 0 && (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
}
/*
diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h
index 14a758b..dd24dc2 100644
--- a/sys/vm/vm_object.h
+++ b/sys/vm/vm_object.h
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_object.h,v 1.5 1995/01/24 10:13:24 davidg Exp $
+ * $Id: vm_object.h,v 1.6 1995/02/02 09:08:56 davidg Exp $
*/
/*
@@ -112,6 +112,7 @@ struct vm_object {
#define OBJ_DEAD 0x0008 /* used to mark dead objects during rundown */
#define OBJ_ILOCKED 0x0010 /* lock from modification */
#define OBJ_ILOCKWT 0x0020 /* wait for lock from modification */
+#define OBJ_PIPWNT 0x0040 /* paging in progress wanted */
TAILQ_HEAD(vm_object_hash_head, vm_object_hash_entry);
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index f850adc..6ee2291 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -65,7 +65,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pageout.c,v 1.35 1995/02/14 06:09:15 phk Exp $
+ * $Id: vm_pageout.c,v 1.36 1995/02/20 23:35:45 davidg Exp $
*/
/*
@@ -290,8 +290,11 @@ vm_pageout_clean(m, sync)
* collapse.
*/
if (pageout_status[i] != VM_PAGER_PEND) {
- if (--object->paging_in_progress == 0)
+ if ((--object->paging_in_progress == 0) &&
+ (object->flags & OBJ_PIPWNT)) {
+ object->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) object);
+ }
if ((ms[i]->flags & (PG_REFERENCED|PG_WANTED)) ||
pmap_is_referenced(VM_PAGE_TO_PHYS(ms[i]))) {
pmap_clear_reference(VM_PAGE_TO_PHYS(ms[i]));
diff --git a/sys/vm/vnode_pager.c b/sys/vm/vnode_pager.c
index 76831a9..be36ec9 100644
--- a/sys/vm/vnode_pager.c
+++ b/sys/vm/vnode_pager.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
- * $Id: vnode_pager.c,v 1.22 1995/02/03 06:46:28 davidg Exp $
+ * $Id: vnode_pager.c,v 1.23 1995/02/21 01:22:48 davidg Exp $
*/
/*
@@ -225,6 +225,7 @@ vnode_pager_dealloc(pager)
object = (vm_object_t) vp->v_vmdata;
if (object) {
while (object->paging_in_progress) {
+ object->flags |= OBJ_PIPWNT;
tsleep(object, PVM, "vnpdea", 0);
}
}
@@ -565,8 +566,11 @@ vnode_pager_iodone(bp)
pmap_qremove(paddr, npages);
if (obj) {
--obj->paging_in_progress;
- if (obj->paging_in_progress == 0)
+ if (obj->paging_in_progress == 0 &&
+ (obj->flags & OBJ_PIPWNT)) {
+ obj->flags &= ~OBJ_PIPWNT;
wakeup((caddr_t) obj);
+ }
} else {
panic("vnode_pager_iodone: object is gone???");
}
OpenPOWER on IntegriCloud