Author: alc
Date: Wed Sep 26 03:54:55 2012
New Revision: 240947
URL: http://svn.freebsd.org/changeset/base/240947

Log:
  MFC r240862
    Address a race condition that was introduced in r238212.  Unless the page
    queues lock is acquired before the page lock is released, there is no
    guarantee that the page will still be in that same page queue when
    vm_page_requeue() is called.

Modified:
  stable/9/sys/vm/vm_pageout.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/vm/vm_pageout.c
==============================================================================
--- stable/9/sys/vm/vm_pageout.c        Wed Sep 26 03:45:42 2012        
(r240946)
+++ stable/9/sys/vm/vm_pageout.c        Wed Sep 26 03:54:55 2012        
(r240947)
@@ -999,9 +999,9 @@ vm_pageout_scan(int pass)
                         * Those objects are in a "rundown" state.
                         */
                        if (!swap_pageouts_ok || (object->flags & OBJ_DEAD)) {
+                               vm_page_lock_queues();
                                vm_page_unlock(m);
                                VM_OBJECT_UNLOCK(object);
-                               vm_page_lock_queues();
                                queues_locked = TRUE;
                                vm_page_requeue(m);
                                goto relock_queues;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to