o Lock some page queue accesses, in particular, those by vm_page_unwire().

This commit is contained in:
alc 2002-07-13 19:24:04 +00:00
parent 1ca394c8d3
commit ee4b41f6c5
2 changed files with 8 additions and 1 deletions

View File

@ -866,6 +866,7 @@ RetryFault:;
if (((fault_flags & VM_FAULT_WIRE_MASK) == 0) && (wired == 0)) {
pmap_prefault(fs.map->pmap, vaddr, fs.entry);
}
vm_page_lock_queues();
vm_page_flag_clear(fs.m, PG_ZERO);
vm_page_flag_set(fs.m, PG_MAPPED|PG_REFERENCED);
@ -881,7 +882,7 @@ RetryFault:;
} else {
vm_page_activate(fs.m);
}
vm_page_unlock_queues();
mtx_lock_spin(&sched_lock);
if (curproc && (curproc->p_sflag & PS_INMEM) && curproc->p_stats) {
if (hardfault) {
@ -1004,7 +1005,9 @@ vm_fault_unwire(map, start, end)
pa = pmap_extract(pmap, va);
if (pa != (vm_offset_t) 0) {
pmap_change_wiring(pmap, va, FALSE);
vm_page_lock_queues();
vm_page_unwire(PHYS_TO_VM_PAGE(pa), 1);
vm_page_unlock_queues();
}
}
mtx_unlock(&Giant);

View File

@ -266,11 +266,13 @@ vm_proc_dispose(struct proc *p)
upobj = p->p_upages_obj;
if (upobj->resident_page_count != UAREA_PAGES)
panic("vm_proc_dispose: incorrect number of pages in upobj");
vm_page_lock_queues();
while ((m = TAILQ_FIRST(&upobj->memq)) != NULL) {
vm_page_busy(m);
vm_page_unwire(m, 0);
vm_page_free(m);
}
vm_page_unlock_queues();
up = (vm_offset_t)p->p_uarea;
pmap_qremove(up, UAREA_PAGES);
kmem_free(kernel_map, up, UAREA_PAGES * PAGE_SIZE);
@ -291,10 +293,12 @@ vm_proc_swapout(struct proc *p)
upobj = p->p_upages_obj;
if (upobj->resident_page_count != UAREA_PAGES)
panic("vm_proc_dispose: incorrect number of pages in upobj");
vm_page_lock_queues();
TAILQ_FOREACH(m, &upobj->memq, listq) {
vm_page_dirty(m);
vm_page_unwire(m, 0);
}
vm_page_unlock_queues();
up = (vm_offset_t)p->p_uarea;
pmap_qremove(up, UAREA_PAGES);
}