summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2002-10-19 18:34:39 +0000
committerAlan Cox <alc@FreeBSD.org>2002-10-19 18:34:39 +0000
commitf4ecdf056e29bda18b069adfb623e95a3d962d3e (patch)
tree88f4a80e77d2148a374337006d0530d2d24d5236 /sys
parentb6a185302e38a05aa2a33a70f0d24e5785334b9d (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/vm/vm_fault.c4
-rw-r--r--sys/vm/vm_page.c8
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
index 37ff14231ba6..058107e0bbb8 100644
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -319,12 +319,13 @@ RetryFault:;
/*
* check for page-based copy on write
*/
-
+ vm_page_lock_queues();
if ((fs.m->cow) &&
(fault_type & VM_PROT_WRITE)) {
s = splvm();
vm_page_cowfault(fs.m);
splx(s);
+ vm_page_unlock_queues();
unlock_things(&fs);
goto RetryFault;
}
@@ -345,7 +346,6 @@ RetryFault:;
* around with a vm_page_t->busy page except, perhaps,
* to pmap it.
*/
- vm_page_lock_queues();
if ((fs.m->flags & PG_BUSY) || fs.m->busy) {
vm_page_unlock_queues();
unlock_things(&fs);
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 74b520c4c5d9..f8730c1182fd 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -1815,10 +1815,16 @@ vm_page_cowfault(vm_page_t m)
retry_alloc:
vm_page_remove(m);
- mnew = vm_page_alloc(object, pindex, VM_ALLOC_NORMAL);
+ /*
+ * An interrupt allocation is requested because the page
+ * queues lock is held.
+ */
+ mnew = vm_page_alloc(object, pindex, VM_ALLOC_INTERRUPT);
if (mnew == NULL) {
vm_page_insert(m, object, pindex);
+ vm_page_unlock_queues();
VM_WAIT;
+ vm_page_lock_queues();
goto retry_alloc;
}