Pass VM_ALLOC_NOBUSY to vm_page_grab() so that we don't have to call

vm_page_flag_clear(PG_BUSY).  The object lock is held the entire time.
Thus, whether or not the PG_BUSY flag is set is invisible to others.
This commit is contained in:
Alan Cox 2004-12-11 22:35:16 +00:00
parent 1ab58cc2df
commit 5031dd39f0

View File

@ -1022,11 +1022,10 @@ pmap_pinit(pmap_t pm)
VM_OBJECT_LOCK(pm->pm_tsb_obj);
for (i = 0; i < TSB_PAGES; i++) {
m = vm_page_grab(pm->pm_tsb_obj, i,
m = vm_page_grab(pm->pm_tsb_obj, i, VM_ALLOC_NOBUSY |
VM_ALLOC_RETRY | VM_ALLOC_WIRED | VM_ALLOC_ZERO);
vm_page_lock_queues();
vm_page_flag_clear(m, PG_BUSY);
m->valid = VM_PAGE_BITS_ALL;
m->md.pmap = pm;
vm_page_unlock_queues();