svn commit: r234554 - head/sys/vm

Alan Cox alc at FreeBSD.org
Sat Apr 21 18:26:16 UTC 2012


Author: alc
Date: Sat Apr 21 18:26:16 2012
New Revision: 234554
URL: http://svn.freebsd.org/changeset/base/234554

Log:
  As documented in vm_page.h, updates to the vm_page's flags no longer
  require the page queues lock.
  
  MFC after:	1 week

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sat Apr 21 18:14:46 2012	(r234553)
+++ head/sys/vm/vm_page.c	Sat Apr 21 18:26:16 2012	(r234554)
@@ -2155,13 +2155,10 @@ vm_page_unwire(vm_page_t m, int activate
 			if ((m->oflags & VPO_UNMANAGED) != 0 ||
 			    m->object == NULL)
 				return;
-			vm_page_lock_queues();
-			if (activate)
-				vm_page_enqueue(PQ_ACTIVE, m);
-			else {
+			if (!activate)
 				m->flags &= ~PG_WINATCFLS;
-				vm_page_enqueue(PQ_INACTIVE, m);
-			}
+			vm_page_lock_queues();
+			vm_page_enqueue(activate ? PQ_ACTIVE : PQ_INACTIVE, m);
 			vm_page_unlock_queues();
 		}
 	} else
@@ -2201,8 +2198,8 @@ _vm_page_deactivate(vm_page_t m, int ath
 	if ((queue = m->queue) == PQ_INACTIVE)
 		return;
 	if (m->wire_count == 0 && (m->oflags & VPO_UNMANAGED) == 0) {
-		vm_page_lock_queues();
 		m->flags &= ~PG_WINATCFLS;
+		vm_page_lock_queues();
 		if (queue != PQ_NONE)
 			vm_page_queue_remove(queue, m);
 		if (athead)


More information about the svn-src-all mailing list