summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-12-02 04:54:21 +0000
committeralc <alc@FreeBSD.org>2002-12-02 04:54:21 +0000
commitdd30d349af220ce4f07d30548190b0ee7b8e4106 (patch)
treea140b58d4a4ffec8dec72799379ce5684dd435b9 /sys/i386
parent4af26db23aa536ce300778fff12649469e43dadc (diff)
downloadFreeBSD-src-dd30d349af220ce4f07d30548190b0ee7b8e4106.zip
FreeBSD-src-dd30d349af220ce4f07d30548190b0ee7b8e4106.tar.gz
Hold the page queues lock when calling pmap_unwire_pte_hold() or
pmap_remove_pte(). Use vm_page_sleep_if_busy() in _pmap_unwire_pte_hold() so that the page queues lock is released when sleeping. Approved by: re (blanket)
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/pmap.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c
index 5da015a..c842eff 100644
--- a/sys/i386/i386/pmap.c
+++ b/sys/i386/i386/pmap.c
@@ -1149,8 +1149,8 @@ static int
_pmap_unwire_pte_hold(pmap_t pmap, vm_page_t m)
{
- while (vm_page_sleep_busy(m, FALSE, "pmuwpt"))
- ;
+ while (vm_page_sleep_if_busy(m, FALSE, "pmuwpt"))
+ vm_page_lock_queues();
if (m->hold_count == 0) {
vm_offset_t pteva;
@@ -2133,7 +2133,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot,
*/
if (opa) {
int err;
+ vm_page_lock_queues();
err = pmap_remove_pte(pmap, pte, va);
+ vm_page_unlock_queues();
if (err)
panic("pmap_enter: pte vanished, va: 0x%x", va);
}
@@ -2252,8 +2254,11 @@ retry:
*/
pte = vtopte(va);
if (*pte) {
- if (mpte)
+ if (mpte != NULL) {
+ vm_page_lock_queues();
pmap_unwire_pte_hold(pmap, mpte);
+ vm_page_unlock_queues();
+ }
return 0;
}
@@ -2667,7 +2672,9 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_t dst_addr, vm_size_t len,
pmap_insert_entry(dst_pmap, addr,
dstmpte, m);
} else {
+ vm_page_lock_queues();
pmap_unwire_pte_hold(dst_pmap, dstmpte);
+ vm_page_unlock_queues();
}
if (dstmpte->hold_count >= srcmpte->hold_count)
break;
OpenPOWER on IntegriCloud