Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2013 21:14:55 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254163 - head/sys/vm
Message-ID:  <201308092114.r79LEtQ8028971@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Aug  9 21:14:55 2013
New Revision: 254163
URL: http://svnweb.freebsd.org/changeset/base/254163

Log:
  Revert the addition of VPO_BUSY and instead update vm_page_replace() to
  properly unbusy the page.
  
  Submitted by:	alc

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_page.h

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Fri Aug  9 21:04:00 2013	(r254162)
+++ head/sys/vm/vm_page.c	Fri Aug  9 21:14:55 2013	(r254163)
@@ -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_objec
 	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)

Modified: head/sys/vm/vm_page.h
==============================================================================
--- head/sys/vm/vm_page.h	Fri Aug  9 21:04:00 2013	(r254162)
+++ head/sys/vm/vm_page.h	Fri Aug  9 21:14:55 2013	(r254163)
@@ -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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308092114.r79LEtQ8028971>