Author: alc
Date: Sun Sep 27 01:35:32 2015
New Revision: 288288
URL: https://svnweb.freebsd.org/changeset/base/288288

Log:
  MFC r287121
    Testing whether a page is dirty does not require the page lock.

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

Modified: stable/10/sys/vm/vm_pageout.c
==============================================================================
--- stable/10/sys/vm/vm_pageout.c       Sun Sep 27 01:33:43 2015        
(r288287)
+++ stable/10/sys/vm/vm_pageout.c       Sun Sep 27 01:35:32 2015        
(r288288)
@@ -408,10 +408,13 @@ more:
                        ib = 0;
                        break;
                }
-               vm_page_lock(p);
                vm_page_test_dirty(p);
-               if (p->dirty == 0 ||
-                   p->queue != PQ_INACTIVE ||
+               if (p->dirty == 0) {
+                       ib = 0;
+                       break;
+               }
+               vm_page_lock(p);
+               if (p->queue != PQ_INACTIVE ||
                    p->hold_count != 0) {       /* may be undergoing I/O */
                        vm_page_unlock(p);
                        ib = 0;
@@ -435,10 +438,11 @@ more:
 
                if ((p = vm_page_next(ps)) == NULL || vm_page_busied(p))
                        break;
-               vm_page_lock(p);
                vm_page_test_dirty(p);
-               if (p->dirty == 0 ||
-                   p->queue != PQ_INACTIVE ||
+               if (p->dirty == 0)
+                       break;
+               vm_page_lock(p);
+               if (p->queue != PQ_INACTIVE ||
                    p->hold_count != 0) {       /* may be undergoing I/O */
                        vm_page_unlock(p);
                        break;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to