summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/vm/phys_pager.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c
index 82ce6f2..67d1ad0 100644
--- a/sys/vm/phys_pager.c
+++ b/sys/vm/phys_pager.c
@@ -139,17 +139,19 @@ phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage)
int i, s;
s = splvm();
+ vm_page_lock_queues();
/*
* Fill as many pages as vm_fault has allocated for us.
*/
for (i = 0; i < count; i++) {
- if ((m[i]->flags & PG_ZERO) == 0)
+ if ((m[i]->flags & PG_ZERO) == 0) {
+ vm_page_unlock_queues();
pmap_zero_page(m[i]);
- /* Switch off pv_entries */
- vm_page_lock_queues();
+ vm_page_lock_queues();
+ }
vm_page_flag_set(m[i], PG_ZERO);
+ /* Switch off pv_entries */
vm_page_unmanage(m[i]);
- vm_page_unlock_queues();
m[i]->valid = VM_PAGE_BITS_ALL;
m[i]->dirty = 0;
/* The requested page must remain busy, the others not. */
@@ -158,6 +160,7 @@ phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage)
m[i]->busy = 0;
}
}
+ vm_page_unlock_queues();
splx(s);
return (VM_PAGER_OK);
OpenPOWER on IntegriCloud