From owner-svn-src-head@FreeBSD.ORG Wed Jun 25 03:30:03 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED37AE8F; Wed, 25 Jun 2014 03:30:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB06D20B0; Wed, 25 Jun 2014 03:30:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5P3U35f030622; Wed, 25 Jun 2014 03:30:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5P3U36V030621; Wed, 25 Jun 2014 03:30:03 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201406250330.s5P3U36V030621@svn.freebsd.org> From: Alan Cox Date: Wed, 25 Jun 2014 03:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267850 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jun 2014 03:30:04 -0000 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;