From e9ba21a5bb6dada10bb679cc6de4d1ac8e22b9cb Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 29 Apr 2006 00:59:15 +0000 Subject: [PATCH] Eliminate unnecessary, recursive acquisitions and releases of the page queues lock by free_pv_entry() and pmap_remove_pages(). Reduce the scope of the page queues lock in pmap_remove_pages(). --- sys/amd64/amd64/pmap.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index da7d300c2de6..fd5e21dcb7a7 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1546,6 +1546,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv) struct pv_chunk *pc; int idx, field, bit; + mtx_assert(&vm_page_queue_mtx, MA_OWNED); PV_STAT(pv_entry_frees++); PV_STAT(pv_entry_spare++); pv_entry_count--; @@ -1567,9 +1568,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv) TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_lock_queues(); vm_page_free(m); - vm_page_unlock_queues(); } /* @@ -2802,14 +2801,12 @@ pmap_remove_pages(pmap_t pmap) TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); dump_drop_page(m->phys_addr); - vm_page_lock_queues(); vm_page_free(m); - vm_page_unlock_queues(); } } + vm_page_unlock_queues(); pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); } /*