diff options
author | alc <alc@FreeBSD.org> | 2006-06-05 06:08:21 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2006-06-05 06:08:21 +0000 |
commit | efb5d1da267cf0d69ea6476f7be7637127a14bd7 (patch) | |
tree | 75f1f1261cadf4e1479303bca1cff2ed6f62c3b2 | |
parent | bd7824e136bd3a80fe47866d756a0c0f7abc033f (diff) | |
download | FreeBSD-src-efb5d1da267cf0d69ea6476f7be7637127a14bd7.zip FreeBSD-src-efb5d1da267cf0d69ea6476f7be7637127a14bd7.tar.gz |
MFamd64
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().
-rw-r--r-- | sys/i386/i386/pmap.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 1299791..e073c1a 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -1698,6 +1698,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--; @@ -1719,10 +1720,8 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv) TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); - vm_page_lock_queues(); vm_page_unwire(m, 0); vm_page_free(m); - vm_page_unlock_queues(); pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc); } @@ -2970,17 +2969,15 @@ pmap_remove_pages(pmap_t pmap) TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(pmap_kextract((vm_offset_t)pc)); pmap_qremove((vm_offset_t)pc, 1); - vm_page_lock_queues(); vm_page_unwire(m, 0); vm_page_free(m); - vm_page_unlock_queues(); pmap_ptelist_free(&pv_vafree, (vm_offset_t)pc); } } sched_unpin(); + vm_page_unlock_queues(); pmap_invalidate_all(pmap); PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); } /* |