summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2010-05-03 07:00:50 +0000
committeralc <alc@FreeBSD.org>2010-05-03 07:00:50 +0000
commitdda80c9587fba3b3c842e555ef7d08ed0949a600 (patch)
treed661b0f4a38e16f498b353d17944068727a490bd /sys/vm
parent387e15c45aad8ee988d094eebcf76078a1a4752c (diff)
downloadFreeBSD-src-dda80c9587fba3b3c842e555ef7d08ed0949a600.zip
FreeBSD-src-dda80c9587fba3b3c842e555ef7d08ed0949a600.tar.gz
Assert that the page queues lock is held in vm_page_remove() and
vm_page_unwire() only if the page is managed, i.e., pageable.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_page.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index 59f8226..acec3b7 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -790,6 +790,8 @@ vm_page_remove(vm_page_t m)
vm_object_t object;
vm_page_t root;
+ if ((m->flags & PG_UNMANAGED) == 0)
+ mtx_assert(&vm_page_queue_mtx, MA_OWNED);
if ((object = m->object) == NULL)
return;
VM_OBJECT_LOCK_ASSERT(object, MA_OWNED);
@@ -797,7 +799,6 @@ vm_page_remove(vm_page_t m)
m->oflags &= ~VPO_BUSY;
vm_page_flash(m);
}
- mtx_assert(&vm_page_queue_mtx, MA_OWNED);
/*
* Now remove from the object's list of backed pages.
@@ -1586,7 +1587,8 @@ void
vm_page_unwire(vm_page_t m, int activate)
{
- mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+ if ((m->flags & PG_UNMANAGED) == 0)
+ mtx_assert(&vm_page_queue_mtx, MA_OWNED);
if (m->flags & PG_FICTITIOUS)
return;
if (m->wire_count > 0) {
OpenPOWER on IntegriCloud