svn commit: r331128 - head/sys/vm
Mark Johnston
markj at FreeBSD.org
Sun Mar 18 16:35:40 UTC 2018
Author: markj
Date: Sun Mar 18 16:35:40 2018
New Revision: 331128
URL: https://svnweb.freebsd.org/changeset/base/331128
Log:
Have vm_page_replace() assert that the new page is not enqueued.
The new page does not belong to a VM object, but the page daemon does
not expect to encounter such pages.
Reviewed by: alc, kib
Tested by: pho
MFC after: 1 week
X-Differential Revision: https://reviews.freebsd.org/D14625
Modified:
head/sys/vm/vm_page.c
Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c Sun Mar 18 16:24:11 2018 (r331127)
+++ head/sys/vm/vm_page.c Sun Mar 18 16:35:40 2018 (r331128)
@@ -1505,7 +1505,9 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm
VM_OBJECT_ASSERT_WLOCKED(object);
KASSERT(mnew->object == NULL,
- ("vm_page_replace: page already in object"));
+ ("vm_page_replace: page %p already in object", mnew));
+ KASSERT(mnew->queue == PQ_NONE,
+ ("vm_page_replace: new page %p is on a paging queue", mnew));
/*
* This function mostly follows vm_page_insert() and
@@ -1517,7 +1519,7 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm
mnew->pindex = pindex;
mold = vm_radix_replace(&object->rtree, mnew);
KASSERT(mold->queue == PQ_NONE,
- ("vm_page_replace: mold is on a paging queue"));
+ ("vm_page_replace: old page %p is on a paging queue", mold));
/* Keep the resident page list in sorted order. */
TAILQ_INSERT_AFTER(&object->memq, mold, mnew, listq);
More information about the svn-src-all
mailing list