summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/phys_pager.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/vm/phys_pager.c b/sys/vm/phys_pager.c
index a5fe74c..cdeb614 100644
--- a/sys/vm/phys_pager.c
+++ b/sys/vm/phys_pager.c
@@ -142,17 +142,19 @@ phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int reqpage)
int i;
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
- vm_page_lock_queues();
for (i = 0; i < count; i++) {
- if ((m[i]->flags & PG_ZERO) == 0) {
- vm_page_unlock_queues();
- pmap_zero_page(m[i]);
- vm_page_lock_queues();
+ if (m[i]->valid == 0) {
+ if ((m[i]->flags & PG_ZERO) == 0)
+ pmap_zero_page(m[i]);
+ m[i]->valid = VM_PAGE_BITS_ALL;
}
- vm_page_flag_set(m[i], PG_ZERO);
+ KASSERT(m[i]->valid == VM_PAGE_BITS_ALL,
+ ("phys_pager_getpages: partially valid page %p", m[i]));
+ }
+ vm_page_lock_queues();
+ for (i = 0; i < count; i++) {
/* Switch off pv_entries */
vm_page_unmanage(m[i]);
- m[i]->valid = VM_PAGE_BITS_ALL;
m[i]->dirty = 0;
/* The requested page must remain busy, the others not. */
if (reqpage != i) {
OpenPOWER on IntegriCloud