diff --git a/sys/mips/mips/pmap.c b/sys/mips/mips/pmap.c index 2b18e85591f3..86ef25d9243e 100644 --- a/sys/mips/mips/pmap.c +++ b/sys/mips/mips/pmap.c @@ -885,8 +885,12 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m) /* * If the page is finally unwired, simply free it. */ - pmap_release_pte_page(m); atomic_subtract_int(&cnt.v_wire_count, 1); + PMAP_UNLOCK(pmap); + vm_page_unlock_queues(); + pmap_release_pte_page(m); + vm_page_lock_queues(); + PMAP_LOCK(pmap); return (1); } @@ -1007,9 +1011,14 @@ pmap_alloc_pte_page(pmap_t pmap, unsigned int index, int wait, vm_offset_t *vap) paddr = MIPS_KSEG0_TO_PHYS(va); m = PHYS_TO_VM_PAGE(paddr); + if (!locked) + vm_page_lock_queues(); m->pindex = index; m->valid = VM_PAGE_BITS_ALL; m->wire_count = 1; + if (!locked) + vm_page_unlock_queues(); + atomic_add_int(&cnt.v_wire_count, 1); *vap = (vm_offset_t)va; return (m);