svn commit: r207577 - head/sys/vm

Alan Cox alc at FreeBSD.org
Mon May 3 17:55:32 UTC 2010


Author: alc
Date: Mon May  3 17:55:32 2010
New Revision: 207577
URL: http://svn.freebsd.org/changeset/base/207577

Log:
  Acquire the page lock around vm_page_wire() in vm_page_grab().
  
  Assert that the page lock is held in vm_page_wire().

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Mon May  3 17:35:31 2010	(r207576)
+++ head/sys/vm/vm_page.c	Mon May  3 17:55:32 2010	(r207577)
@@ -1544,6 +1544,7 @@ vm_page_wire(vm_page_t m)
 	 * it is already off the queues).
 	 */
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
+	vm_page_lock_assert(m, MA_OWNED);
 	if (m->flags & PG_FICTITIOUS)
 		return;
 	if (m->wire_count == 0) {
@@ -1914,9 +1915,11 @@ retrylookup:
 			goto retrylookup;
 		} else {
 			if ((allocflags & VM_ALLOC_WIRED) != 0) {
+				vm_page_lock(m);
 				vm_page_lock_queues();
 				vm_page_wire(m);
 				vm_page_unlock_queues();
+				vm_page_unlock(m);
 			}
 			if ((allocflags & VM_ALLOC_NOBUSY) == 0)
 				vm_page_busy(m);


More information about the svn-src-head mailing list