Index: sys/vm/vm_map.c =================================================================== --- sys/vm/vm_map.c +++ sys/vm/vm_map.c @@ -1644,15 +1644,13 @@ } static bool -vm_map_mergeable_neighbors(vm_map_entry_t prev, vm_map_entry_t entry) +vm_map_simplify_neighbor_test(vm_map_entry_t prev, vm_map_entry_t entry) { - vm_size_t prevsize; - prevsize = prev->end - prev->start; return (prev->end == entry->start && prev->object.vm_object == entry->object.vm_object && (prev->object.vm_object == NULL || - prev->offset + prevsize == entry->offset) && + prev->offset + prev->end - prev->start == entry->offset) && prev->eflags == entry->eflags && prev->protection == entry->protection && prev->max_protection == entry->max_protection && @@ -1662,22 +1660,18 @@ } static void -vm_map_merged_neighbor_dispose(vm_map_t map, vm_map_entry_t entry) +vm_map_simplify_neighbor_deallocate(vm_map_t map, vm_map_entry_t entry) { /* - * If the backing object is a vnode object, - * vm_object_deallocate() calls vrele(). - * However, vrele() does not lock the vnode - * because the vnode has additional - * references. Thus, the map lock can be kept - * without causing a lock-order reversal with - * the vnode lock. + * If the backing object is a vnode object, vm_object_deallocate() + * calls vrele(). However, vrele() does not lock the vnode because the + * vnode has additional references. Thus, the map lock can be kept + * without causing a lock-order reversal with the vnode lock. * - * Since we count the number of virtual page - * mappings in object->un_pager.vnp.writemappings, - * the writemappings value should not be adjusted - * when the entry is disposed of. + * Since we count the number of virtual page mappings in + * object->un_pager.vnp.writemappings, the writemappings value should + * not be adjusted when the entry is disposed of. */ if (entry->object.vm_object != NULL) vm_object_deallocate(entry->object.vm_object); @@ -1709,22 +1703,22 @@ prev = entry->prev; if (prev != &map->header && - vm_map_mergeable_neighbors(prev, entry)) { + vm_map_simplify_neighbor_test(prev, entry)) { vm_map_entry_unlink(map, prev); entry->start = prev->start; entry->offset = prev->offset; if (entry->prev != &map->header) vm_map_entry_resize_free(map, entry->prev); - vm_map_merged_neighbor_dispose(map, prev); + vm_map_simplify_neighbor_deallocate(map, prev); } next = entry->next; if (next != &map->header && - vm_map_mergeable_neighbors(entry, next)) { + vm_map_simplify_neighbor_test(entry, next)) { vm_map_entry_unlink(map, next); entry->end = next->end; vm_map_entry_resize_free(map, entry); - vm_map_merged_neighbor_dispose(map, next); + vm_map_simplify_neighbor_deallocate(map, next); } } /*