Author: kib
Date: Fri Dec 27 16:59:47 2013
New Revision: 259951
URL: http://svnweb.freebsd.org/changeset/base/259951

Log:
  Do not coalesce stack entry, vm_map_stack() asserts that the requested
  region is claimed by a new entry.
  
  Pass MAP_STACK_GROWS_DOWN and MAP_STACK_GROWS_UP flags to
  vm_map_insert() from vm_map_stack(), to really turn off coalescing
  code and call to vm_map_simplify_entry() [1].
  
  Reported by:  avg, peter, many
  Tested by:    avg, peter
  Noted by:     avg [1]
  Sponsored by: The FreeBSD Foundation
  MFC after:    1 week

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c        Fri Dec 27 16:57:38 2013        (r259950)
+++ head/sys/vm/vm_map.c        Fri Dec 27 16:59:47 2013        (r259951)
@@ -1207,6 +1207,7 @@ charged:
        }
        else if ((prev_entry != &map->header) &&
                 (prev_entry->eflags == protoeflags) &&
+                (cow & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP)) == 0 &&
                 (prev_entry->end == start) &&
                 (prev_entry->wired_count == 0) &&
                 (prev_entry->cred == cred ||
@@ -3339,7 +3340,6 @@ vm_map_stack(vm_map_t map, vm_offset_t a
         * NOTE: We explicitly allow bi-directional stacks.
         */
        orient = cow & (MAP_STACK_GROWS_DOWN|MAP_STACK_GROWS_UP);
-       cow &= ~orient;
        KASSERT(orient != 0, ("No stack grow direction"));
 
        if (addrbos < vm_map_min(map) ||
_______________________________________________
[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