Now that free_pv_entry() accesses the pmap, call free_pv_entry() in

pmap_remove_all() before rather than after the pmap is unlocked.  At
present, the page queues lock provides sufficient sychronization.  In the
future, the page queues lock may not always be held when free_pv_entry() is
called.
This commit is contained in:
Alan Cox 2006-07-17 03:10:17 +00:00
parent f2f0337e84
commit e4cec28398
2 changed files with 4 additions and 2 deletions

View File

@ -1627,6 +1627,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv)
int idx, field, bit;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
PV_STAT(pv_entry_frees++);
PV_STAT(pv_entry_spare++);
pv_entry_count--;
@ -2015,8 +2016,8 @@ pmap_remove_all(vm_page_t m)
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
m->md.pv_list_count--;
pmap_unuse_pt(pmap, pv->pv_va, ptepde);
PMAP_UNLOCK(pmap);
free_pv_entry(pmap, pv);
PMAP_UNLOCK(pmap);
}
vm_page_flag_clear(m, PG_WRITEABLE);
}

View File

@ -1702,6 +1702,7 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv)
int idx, field, bit;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
PMAP_LOCK_ASSERT(pmap, MA_OWNED);
PV_STAT(pv_entry_frees++);
PV_STAT(pv_entry_spare++);
pv_entry_count--;
@ -2097,8 +2098,8 @@ pmap_remove_all(vm_page_t m)
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
m->md.pv_list_count--;
pmap_unuse_pt(pmap, pv->pv_va);
PMAP_UNLOCK(pmap);
free_pv_entry(pmap, pv);
PMAP_UNLOCK(pmap);
}
vm_page_flag_clear(m, PG_WRITEABLE);
sched_unpin();