summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-08 20:34:01 +0000
committeralc <alc@FreeBSD.org>2010-05-08 20:34:01 +0000
commit40b44f9713de70170857e6291876dfce94b6ef43 (patch)
tree55e1683864edab13ef62b5f9fac6a4928f23f506 /sys/sparc64
parent94ac1169df0fe3609aa671582574d421e89b7ff3 (diff)
downloadFreeBSD-src-40b44f9713de70170857e6291876dfce94b6ef43.zip
FreeBSD-src-40b44f9713de70170857e6291876dfce94b6ef43.tar.gz
Push down the page queues into vm_page_cache(), vm_page_try_to_cache(), and
vm_page_try_to_free(). Consequently, push down the page queues lock into pmap_enter_quick(), pmap_page_wired_mapped(), pmap_remove_all(), and pmap_remove_write(). Push down the page queues lock into Xen's pmap_page_is_mapped(). (I overlooked the Xen pmap in r207702.) Switch to a per-processor counter for the total number of pages cached.
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/pmap.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/sparc64/sparc64/pmap.c b/sys/sparc64/sparc64/pmap.c
index 0a90b40..da8714e 100644
--- a/sys/sparc64/sparc64/pmap.c
+++ b/sys/sparc64/sparc64/pmap.c
@@ -1240,7 +1240,7 @@ pmap_remove_all(vm_page_t m)
struct tte *tp;
vm_offset_t va;
- mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+ vm_page_lock_queues();
for (tp = TAILQ_FIRST(&m->md.tte_list); tp != NULL; tp = tpn) {
tpn = TAILQ_NEXT(tp, tte_link);
if ((tp->tte_data & TD_PV) == 0)
@@ -1263,6 +1263,7 @@ pmap_remove_all(vm_page_t m)
PMAP_UNLOCK(pm);
}
vm_page_flag_clear(m, PG_WRITEABLE);
+ vm_page_unlock_queues();
}
int
@@ -1502,9 +1503,11 @@ void
pmap_enter_quick(pmap_t pm, vm_offset_t va, vm_page_t m, vm_prot_t prot)
{
+ vm_page_lock_queues();
PMAP_LOCK(pm);
pmap_enter_locked(pm, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE),
FALSE);
+ vm_page_unlock_queues();
PMAP_UNLOCK(pm);
}
@@ -1809,10 +1812,11 @@ pmap_page_wired_mappings(vm_page_t m)
count = 0;
if ((m->flags & PG_FICTITIOUS) != 0)
return (count);
- mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+ vm_page_lock_queues();
TAILQ_FOREACH(tp, &m->md.tte_list, tte_link)
if ((tp->tte_data & (TD_PV | TD_WIRED)) == (TD_PV | TD_WIRED))
count++;
+ vm_page_unlock_queues();
return (count);
}
@@ -1981,10 +1985,10 @@ pmap_remove_write(vm_page_t m)
struct tte *tp;
u_long data;
- mtx_assert(&vm_page_queue_mtx, MA_OWNED);
if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0 ||
(m->flags & PG_WRITEABLE) == 0)
return;
+ vm_page_lock_queues();
TAILQ_FOREACH(tp, &m->md.tte_list, tte_link) {
if ((tp->tte_data & TD_PV) == 0)
continue;
@@ -1995,6 +1999,7 @@ pmap_remove_write(vm_page_t m)
}
}
vm_page_flag_clear(m, PG_WRITEABLE);
+ vm_page_unlock_queues();
}
int
OpenPOWER on IntegriCloud