summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-10-23 06:15:04 +0000
committerdg <dg@FreeBSD.org>1994-10-23 06:15:04 +0000
commit774ff6d21fbc1839f99d8d99b316d6c1784c4880 (patch)
treedfb05bf9640347bd1b393a9b20b9481a3cabcf50
parent78494663d2dfce914bfbe322765a428d1f40c4a3 (diff)
downloadFreeBSD-src-774ff6d21fbc1839f99d8d99b316d6c1784c4880.zip
FreeBSD-src-774ff6d21fbc1839f99d8d99b316d6c1784c4880.tar.gz
Changed a thread_sleep into an spl protected tsleep. A deadlock can occur
otherwise. Minor efficiency improvement in vm_page_free(). Submitted by: John Dyson
-rw-r--r--sys/vm/vm_fault.c16
-rw-r--r--sys/vm/vm_page.c5
2 files changed, 12 insertions, 9 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 7de36eb..586f772 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.9 1994/10/15 13:33:07 davidg Exp $
+ * $Id: vm_fault.c,v 1.10 1994/10/22 02:18:01 davidg Exp $
*/
/*
@@ -325,12 +325,10 @@ vm_fault(map, vaddr, fault_type, change_wiring)
}
#endif
- if ((cnt.v_free_count < cnt.v_free_min) &&
- swap_pager_full && !object->shadow && (!object->pager ||
+ if (swap_pager_full && !object->shadow && (!object->pager ||
(object->pager && object->pager->pg_type == PG_SWAP &&
!vm_pager_has_page(object->pager, offset+object->paging_offset)))) {
- if (vaddr < VM_MAXUSER_ADDRESS &&
- curproc && curproc->p_pid >= 48) /* XXX */ {
+ if (vaddr < VM_MAXUSER_ADDRESS && curproc && curproc->p_pid >= 48) /* XXX */ {
printf("Process %lu killed by vm_fault -- out of swap\n", (u_long)curproc->p_pid);
psignal(curproc, SIGKILL);
curproc->p_estcpu = 0;
@@ -654,12 +652,16 @@ vm_fault(map, vaddr, fault_type, change_wiring)
* If the page is being brought
* in, wait for it and then retry.
*/
- PAGE_ASSERT_WAIT(copy_m, !change_wiring);
RELEASE_PAGE(m);
copy_object->ref_count--;
vm_object_unlock(copy_object);
UNLOCK_THINGS;
- thread_block("fltcpy");
+ spl = splhigh();
+ if( copy_m->flags & (PG_BUSY|PG_VMIO)) {
+ copy_m->flags |= PG_WANTED;
+ tsleep((caddr_t)copy_m,PSWP,"vmpfwc",0);
+ }
+ splx(spl);
vm_object_deallocate(first_object);
goto RetryFault;
}
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index bbd6b73..757d4fd 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91
- * $Id: vm_page.c,v 1.10 1994/10/09 01:52:13 phk Exp $
+ * $Id: vm_page.c,v 1.11 1994/10/18 14:59:19 davidg Exp $
*/
/*
@@ -725,7 +725,8 @@ void vm_page_free(mem)
} else {
splx(s);
}
- wakeup((caddr_t) mem);
+ if( mem->flags & PG_WANTED)
+ wakeup((caddr_t) mem);
cnt.v_tfree++;
}
OpenPOWER on IntegriCloud