From 0b53c91566dc14f4d481c6cdb25b0cf9101482d1 Mon Sep 17 00:00:00 2001 From: alc Date: Sat, 29 Apr 2006 00:59:15 +0000 Subject: 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(-) (limited to 'sys/amd64') diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index da7d300..fd5e21d 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(); } /* -- cgit v1.1