diff options
Diffstat (limited to 'sys/vm/vm_pageout.c')
-rw-r--r-- | sys/vm/vm_pageout.c | 58 |
1 files changed, 28 insertions, 30 deletions
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 98ad6ef..26df38c 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -314,12 +314,9 @@ do_backward: } } - /* - * we allow reads during pageouts... - */ for (i = page_base; i < (page_base + pageout_count); i++) { mc[i]->flags |= PG_BUSY; - vm_page_protect(mc[i], VM_PROT_READ); + vm_page_protect(mc[i], VM_PROT_NONE); } return vm_pageout_flush(&mc[page_base], pageout_count, sync); @@ -359,7 +356,7 @@ vm_pageout_flush(mc, count, sync) * essentially lose the changes by pretending it * worked. */ - pmap_clear_modify(VM_PAGE_TO_PHYS(mt)); + pmap_tc_modified(mt); mt->dirty = 0; break; case VM_PAGER_ERROR: @@ -446,7 +443,7 @@ vm_pageout_object_deactivate_pages(map, object, desired, map_remove_only) continue; } - refcount = pmap_ts_referenced(VM_PAGE_TO_PHYS(p)); + refcount = pmap_tc_referenced(VM_PAGE_TO_PHYS(p)); if (refcount) { p->flags |= PG_REFERENCED; } else if (p->flags & PG_REFERENCED) { @@ -586,7 +583,7 @@ vm_pageout_scan() maxlaunder = (cnt.v_inactive_target > MAXLAUNDER) ? MAXLAUNDER : cnt.v_inactive_target; -rescan0: + maxscan = cnt.v_inactive_count; for( m = TAILQ_FIRST(&vm_page_queue_inactive); @@ -599,7 +596,7 @@ rescan0: cnt.v_pdpages++; if (m->queue != PQ_INACTIVE) { - goto rescan0; + break; } next = TAILQ_NEXT(m, pageq); @@ -621,32 +618,33 @@ rescan0: continue; } - if (m->object->ref_count == 0) { - m->flags &= ~PG_REFERENCED; - pmap_clear_reference(VM_PAGE_TO_PHYS(m)); - } else if (((m->flags & PG_REFERENCED) == 0) && - pmap_ts_referenced(VM_PAGE_TO_PHYS(m))) { - vm_page_activate(m); - continue; - } - - if ((m->flags & PG_REFERENCED) != 0) { - m->flags &= ~PG_REFERENCED; - pmap_clear_reference(VM_PAGE_TO_PHYS(m)); - vm_page_activate(m); - continue; - } + if (m->valid != 0) { + if (m->object->ref_count == 0) { + m->flags &= ~PG_REFERENCED; + pmap_tc_referenced(VM_PAGE_TO_PHYS(m)); + } else if (((m->flags & PG_REFERENCED) == 0) && + pmap_tc_referenced(VM_PAGE_TO_PHYS(m))) { + vm_page_activate(m); + continue; + } - if (m->dirty == 0) { - vm_page_test_dirty(m); - } else if (m->dirty != 0) { - m->dirty = VM_PAGE_BITS_ALL; - } + if ((m->flags & PG_REFERENCED) != 0) { + m->flags &= ~PG_REFERENCED; + pmap_tc_referenced(VM_PAGE_TO_PHYS(m)); + vm_page_activate(m); + continue; + } + if (m->dirty == 0) { + vm_page_test_dirty(m); + } else if (m->dirty != 0) { + m->dirty = VM_PAGE_BITS_ALL; + } + } if (m->valid == 0) { vm_page_protect(m, VM_PROT_NONE); vm_page_free(m); - cnt.v_dfree++; + ++cnt.v_dfree; ++pages_freed; } else if (m->dirty == 0) { vm_page_cache(m); @@ -788,7 +786,7 @@ rescan0: if (m->flags & PG_REFERENCED) { refcount += 1; } - refcount += pmap_ts_referenced(VM_PAGE_TO_PHYS(m)); + refcount += pmap_tc_referenced(VM_PAGE_TO_PHYS(m)); if (refcount) { m->act_count += ACT_ADVANCE + refcount; if (m->act_count > ACT_MAX) |