1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

- Use VM_ALLOC_WIRED.

- Hold the page queues lock around calls to vm_page_flag_clear() and
   vm_page_wakeup().
This commit is contained in:
Alan Cox 2002-12-28 22:47:45 +00:00
parent 25ba12dfe4
commit 2cde7c14b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108369

View File

@ -1011,9 +1011,11 @@ pmap_new_thread(struct thread *td, int pages)
if (oldpte) if (oldpte)
pmap_invalidate_page(kernel_pmap, ks + i * PAGE_SIZE); pmap_invalidate_page(kernel_pmap, ks + i * PAGE_SIZE);
vm_page_lock_queues();
vm_page_wakeup(m); vm_page_wakeup(m);
vm_page_flag_clear(m, PG_ZERO); vm_page_flag_clear(m, PG_ZERO);
m->valid = VM_PAGE_BITS_ALL; m->valid = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
} }
} }
@ -1311,8 +1313,10 @@ pmap_pinit(pmap)
lev1pg = vm_page_grab(pmap->pm_pteobj, NUSERLEV3MAPS + NUSERLEV2MAPS, lev1pg = vm_page_grab(pmap->pm_pteobj, NUSERLEV3MAPS + NUSERLEV2MAPS,
VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED); VM_ALLOC_NORMAL | VM_ALLOC_RETRY | VM_ALLOC_WIRED);
vm_page_lock_queues();
vm_page_flag_clear(lev1pg, PG_BUSY); vm_page_flag_clear(lev1pg, PG_BUSY);
lev1pg->valid = VM_PAGE_BITS_ALL; lev1pg->valid = VM_PAGE_BITS_ALL;
vm_page_unlock_queues();
pmap->pm_lev1 = (pt_entry_t*) ALPHA_PHYS_TO_K0SEG(VM_PAGE_TO_PHYS(lev1pg)); pmap->pm_lev1 = (pt_entry_t*) ALPHA_PHYS_TO_K0SEG(VM_PAGE_TO_PHYS(lev1pg));
if ((lev1pg->flags & PG_ZERO) == 0) if ((lev1pg->flags & PG_ZERO) == 0)
@ -1434,15 +1438,11 @@ _pmap_allocpte(pmap, ptepindex)
* Find or fabricate a new pagetable page * Find or fabricate a new pagetable page
*/ */
m = vm_page_grab(pmap->pm_pteobj, ptepindex, m = vm_page_grab(pmap->pm_pteobj, ptepindex,
VM_ALLOC_ZERO | VM_ALLOC_RETRY); VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY);
KASSERT(m->queue == PQ_NONE, KASSERT(m->queue == PQ_NONE,
("_pmap_allocpte: %p->queue != PQ_NONE", m)); ("_pmap_allocpte: %p->queue != PQ_NONE", m));
if (m->wire_count == 0)
cnt.v_wire_count++;
m->wire_count++;
/* /*
* Increment the hold count for the page table page * Increment the hold count for the page table page
* (denoting a new mapping.) * (denoting a new mapping.)
@ -1486,9 +1486,11 @@ _pmap_allocpte(pmap, ptepindex)
if ((m->flags & PG_ZERO) == 0) if ((m->flags & PG_ZERO) == 0)
bzero((caddr_t) ALPHA_PHYS_TO_K0SEG(ptepa), PAGE_SIZE); bzero((caddr_t) ALPHA_PHYS_TO_K0SEG(ptepa), PAGE_SIZE);
vm_page_lock_queues();
m->valid = VM_PAGE_BITS_ALL; m->valid = VM_PAGE_BITS_ALL;
vm_page_flag_clear(m, PG_ZERO); vm_page_flag_clear(m, PG_ZERO);
vm_page_wakeup(m); vm_page_wakeup(m);
vm_page_unlock_queues();
return m; return m;
} }