summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2006-07-17 03:10:17 +0000
committeralc <alc@FreeBSD.org>2006-07-17 03:10:17 +0000
commit45cb17842617c19d39fe2baf45757f37d2698f9c (patch)
tree00840745b38dcee1d32627da65915d8af9f5ebd1 /sys
parentf457417c4c3c641d7c6e1fa68923519c02a7078e (diff)
downloadFreeBSD-src-45cb17842617c19d39fe2baf45757f37d2698f9c.zip
FreeBSD-src-45cb17842617c19d39fe2baf45757f37d2698f9c.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/amd64/amd64/pmap.c3
-rw-r--r--sys/i386/i386/pmap.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index c5368db..ed96ba7 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -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);
}
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index e280699..24ae059 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -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();
OpenPOWER on IntegriCloud