Author: kib
Date: Wed Jan  4 16:04:20 2012
New Revision: 229495
URL: http://svn.freebsd.org/changeset/base/229495

Log:
  Do not restart the scan in vm_object_page_clean() on the object
  generation change if requested mode is async. The object generation is
  only changed when the object is marked as OBJ_MIGHTBEDIRTY. For async
  mode it is enough to write each dirty page, not to make a guarantee that
  all pages are cleared after the vm_object_page_clean() returned.
  
  Diagnosed by: truckman
  Tested by:    flo
  Reviewed by:  alc, truckman
  MFC after:    2 weeks

Modified:
  head/sys/vm/vm_object.c

Modified: head/sys/vm/vm_object.c
==============================================================================
--- head/sys/vm/vm_object.c     Wed Jan  4 16:02:52 2012        (r229494)
+++ head/sys/vm/vm_object.c     Wed Jan  4 16:04:20 2012        (r229495)
@@ -841,8 +841,12 @@ rescan:
                if (p->valid == 0)
                        continue;
                if (vm_page_sleep_if_busy(p, TRUE, "vpcwai")) {
-                       if (object->generation != curgeneration)
-                               goto rescan;
+                       if (object->generation != curgeneration) {
+                               if ((flags & OBJPC_SYNC) != 0)
+                                       goto rescan;
+                               else
+                                       clearobjflags = 0;
+                       }
                        np = vm_page_find_least(object, pi);
                        continue;
                }
@@ -851,8 +855,12 @@ rescan:
 
                n = vm_object_page_collect_flush(object, p, pagerflags,
                    flags, &clearobjflags);
-               if (object->generation != curgeneration)
-                       goto rescan;
+               if (object->generation != curgeneration) {
+                       if ((flags & OBJPC_SYNC) != 0)
+                               goto rescan;
+                       else
+                               clearobjflags = 0;
+               }
 
                /*
                 * If the VOP_PUTPAGES() did a truncated write, so
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to