summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-06 16:39:43 +0000
committeralc <alc@FreeBSD.org>2010-05-06 16:39:43 +0000
commit4b98b3d3203f8e23130597b9b6ab9f1487ba69e6 (patch)
treedfc0fa6f0a9194a6c782ff3251e16f9d16a9aade /sys/amd64
parente6323f71424e4730372914a47d9b7b5f4bb410b4 (diff)
downloadFreeBSD-src-4b98b3d3203f8e23130597b9b6ab9f1487ba69e6.zip
FreeBSD-src-4b98b3d3203f8e23130597b9b6ab9f1487ba69e6.tar.gz
Push down the page queues lock inside of vm_page_free_toq() and
pmap_page_is_mapped() in preparation for removing page queues locking around calls to vm_page_free(). Setting aside the assertion that calls pmap_page_is_mapped(), vm_page_free_toq() now acquires and holds the page queues lock just long enough to actually add or remove the page from the paging queues. Update vm_page_unhold() to reflect the above change.
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/pmap.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c
index 045b634..3cf15d1 100644
--- a/sys/amd64/amd64/pmap.c
+++ b/sys/amd64/amd64/pmap.c
@@ -3961,16 +3961,15 @@ pmap_pvh_wired_mappings(struct md_page *pvh, int count)
boolean_t
pmap_page_is_mapped(vm_page_t m)
{
- struct md_page *pvh;
+ boolean_t rv;
if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) != 0)
return (FALSE);
- mtx_assert(&vm_page_queue_mtx, MA_OWNED);
- if (TAILQ_EMPTY(&m->md.pv_list)) {
- pvh = pa_to_pvh(VM_PAGE_TO_PHYS(m));
- return (!TAILQ_EMPTY(&pvh->pv_list));
- } else
- return (TRUE);
+ vm_page_lock_queues();
+ rv = !TAILQ_EMPTY(&m->md.pv_list) ||
+ !TAILQ_EMPTY(&pa_to_pvh(VM_PAGE_TO_PHYS(m))->pv_list);
+ vm_page_unlock_queues();
+ return (rv);
}
/*
OpenPOWER on IntegriCloud