From 9f2512bab5d3a80df59c8793a38c943474010fd9 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 3 May 2010 07:00:50 +0000 Subject: [PATCH] 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. --- sys/vm/vm_page.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 59f822664137..acec3b7263b0 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) {