Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Jun 2014 03:30:03 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267850 - head/sys/vm
Message-ID:  <201406250330.s5P3U36V030621@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Wed Jun 25 03:30:03 2014
New Revision: 267850
URL: http://svnweb.freebsd.org/changeset/base/267850

Log:
  Now that vm_map_insert() sets MAP_ENTRY_GROWS_{DOWN,UP} on the stack entries
  that it creates (r267645), we can place the check that blocks map entry
  coalescing on stack entries in vm_map_simplify_entry() where it properly
  belongs.
  
  Reviewed by:	kib

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Wed Jun 25 02:14:55 2014	(r267849)
+++ head/sys/vm/vm_map.c	Wed Jun 25 03:30:03 2014	(r267850)
@@ -1292,12 +1292,12 @@ charged:
 	map->size += new_entry->end - new_entry->start;
 
 	/*
-	 * It may be possible to merge the new entry with the next and/or
-	 * previous entries.  However, due to MAP_STACK_* being a hack, a
-	 * panic can result from merging such entries.
+	 * Try to coalesce the new entry with both the previous and next
+	 * entries in the list.  Previously, we only attempted to coalesce
+	 * with the previous entry when object is NULL.  Here, we handle the
+	 * other cases, which are less common.
 	 */
-	if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0)
-		vm_map_simplify_entry(map, new_entry);
+	vm_map_simplify_entry(map, new_entry);
 
 	if (cow & (MAP_PREFAULT|MAP_PREFAULT_PARTIAL)) {
 		vm_map_pmap_enter(map, start, prot,
@@ -1512,7 +1512,8 @@ vm_map_simplify_entry(vm_map_t map, vm_m
 	vm_map_entry_t next, prev;
 	vm_size_t prevsize, esize;
 
-	if (entry->eflags & (MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP))
+	if ((entry->eflags & (MAP_ENTRY_GROWS_DOWN | MAP_ENTRY_GROWS_UP |
+	    MAP_ENTRY_IN_TRANSITION | MAP_ENTRY_IS_SUB_MAP)) != 0)
 		return;
 
 	prev = entry->prev;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406250330.s5P3U36V030621>