Defer freeing any page table pages in pmap_remove_all() until after the
page queues lock is released. This may reduce the amount of time that the page queues lock is held by pmap_remove_all().
This commit is contained in:
parent
5260c24925
commit
f89998ed71
@ -2796,6 +2796,7 @@ pmap_remove_all(vm_page_t m)
|
||||
|
||||
KASSERT((m->flags & PG_FICTITIOUS) == 0,
|
||||
("pmap_remove_all: page %p is fictitious", m));
|
||||
free = NULL;
|
||||
vm_page_lock_queues();
|
||||
pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
|
||||
while ((pv = TAILQ_FIRST(&pvh->pv_list)) != NULL) {
|
||||
@ -2825,16 +2826,15 @@ pmap_remove_all(vm_page_t m)
|
||||
*/
|
||||
if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW))
|
||||
vm_page_dirty(m);
|
||||
free = NULL;
|
||||
pmap_unuse_pt(pmap, pv->pv_va, *pde, &free);
|
||||
pmap_invalidate_page(pmap, pv->pv_va);
|
||||
pmap_free_zero_pages(free);
|
||||
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
|
||||
free_pv_entry(pmap, pv);
|
||||
PMAP_UNLOCK(pmap);
|
||||
}
|
||||
vm_page_flag_clear(m, PG_WRITEABLE);
|
||||
vm_page_unlock_queues();
|
||||
pmap_free_zero_pages(free);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2900,6 +2900,7 @@ pmap_remove_all(vm_page_t m)
|
||||
|
||||
KASSERT((m->flags & PG_FICTITIOUS) == 0,
|
||||
("pmap_remove_all: page %p is fictitious", m));
|
||||
free = NULL;
|
||||
vm_page_lock_queues();
|
||||
sched_pin();
|
||||
pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
|
||||
@ -2930,10 +2931,8 @@ pmap_remove_all(vm_page_t m)
|
||||
*/
|
||||
if ((tpte & (PG_M | PG_RW)) == (PG_M | PG_RW))
|
||||
vm_page_dirty(m);
|
||||
free = NULL;
|
||||
pmap_unuse_pt(pmap, pv->pv_va, &free);
|
||||
pmap_invalidate_page(pmap, pv->pv_va);
|
||||
pmap_free_zero_pages(free);
|
||||
TAILQ_REMOVE(&m->md.pv_list, pv, pv_list);
|
||||
free_pv_entry(pmap, pv);
|
||||
PMAP_UNLOCK(pmap);
|
||||
@ -2941,6 +2940,7 @@ pmap_remove_all(vm_page_t m)
|
||||
vm_page_flag_clear(m, PG_WRITEABLE);
|
||||
sched_unpin();
|
||||
vm_page_unlock_queues();
|
||||
pmap_free_zero_pages(free);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user