diff options
-rw-r--r-- | sys/vm/vm_page.c | 12 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 1 |
2 files changed, 6 insertions, 7 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 42adc11..39f16c0 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -1174,6 +1174,8 @@ vm_page_prev(vm_page_t m) /* * Uses the page mnew as a replacement for an existing page at index * pindex which must be already present in the object. + * + * The existing page must not be on a paging queue. */ vm_page_t vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex) @@ -1198,16 +1200,14 @@ vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex) mnew->object = object; mnew->pindex = pindex; mold = vm_radix_replace(&object->rtree, mnew, pindex); + KASSERT(mold->queue == PQ_NONE, + ("vm_page_replace: mold is on a paging queue")); /* Detach the old page from the resident tailq. */ TAILQ_REMOVE(&object->memq, mold, listq); - vm_page_lock(mold); - if (mold->oflags & VPO_BUSY) { - mold->oflags &= ~VPO_BUSY; - vm_page_flash(mold); - } + mold->object = NULL; - vm_page_unlock(mold); + vm_page_xunbusy(mold); /* Insert the new page in the resident tailq. */ if (mpred != NULL) diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index a50c409..01c4967 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -171,7 +171,6 @@ struct vm_page { #define VPO_UNMANAGED 0x04 /* no PV management for page */ #define VPO_SWAPINPROG 0x08 /* swap I/O in progress on page */ #define VPO_NOSYNC 0x10 /* do not collect for syncer */ -#define VPO_BUSY 0x20 /* TBD */ /* * Busy page implementation details. |