Author: dougm
Date: Sun Nov 17 06:50:36 2019
New Revision: 354785
URL: https://svnweb.freebsd.org/changeset/base/354785

Log:
  The loop in vm_map_protect that verifies that all transition map
  entries are stabilized, repeatedly verifies the same entry. Check each
  entry in turn.
  
  Reviewed by: kib (code only), alc
  Tested by: pho
  MFC after: 7 days
  Differential Revision: https://reviews.freebsd.org/D22405

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c        Sun Nov 17 03:54:31 2019        (r354784)
+++ head/sys/vm/vm_map.c        Sun Nov 17 06:50:36 2019        (r354785)
@@ -2469,17 +2469,16 @@ again:
                        vm_map_unlock(map);
                        return (KERN_PROTECTION_FAILURE);
                }
-               if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) != 0)
-                       in_tran = entry;
+               if ((current->eflags & MAP_ENTRY_IN_TRANSITION) != 0)
+                       in_tran = current;
        }
 
        /*
-        * Postpone the operation until all in transition map entries
-        * are stabilized.  In-transition entry might already have its
-        * pages wired and wired_count incremented, but
-        * MAP_ENTRY_USER_WIRED flag not yet set, and visible to other
-        * threads because the map lock is dropped.  In this case we
-        * would miss our call to vm_fault_copy_entry().
+        * Postpone the operation until all in-transition map entries have
+        * stabilized.  An in-transition entry might already have its pages
+        * wired and wired_count incremented, but not yet have its
+        * MAP_ENTRY_USER_WIRED flag set.  In which case, we would fail to call
+        * vm_fault_copy_entry() in the final loop below.
         */
        if (in_tran != NULL) {
                in_tran->eflags |= MAP_ENTRY_NEEDS_WAKEUP;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to