svn commit: r234556 - head/sys/vm
Konstantin Belousov
kib at FreeBSD.org
Sat Apr 21 18:36:54 UTC 2012
Author: kib
Date: Sat Apr 21 18:36:53 2012
New Revision: 234556
URL: http://svn.freebsd.org/changeset/base/234556
Log:
When MAP_STACK mapping is created, the map entry is created only to
cover the initial stack size. For MCL_WIREFUTURE maps, the subsequent
call to vm_map_wire() to wire the whole stack region fails due to
VM_MAP_WIRE_NOHOLES flag.
Use the VM_MAP_WIRE_HOLESOK to only wire mapped part of the stack.
Reported and tested by: Sushanth Rai <sushanth_rai yahoo com>
Reviewed by: alc
MFC after: 1 week
Modified:
head/sys/vm/vm_mmap.c
Modified: head/sys/vm/vm_mmap.c
==============================================================================
--- head/sys/vm/vm_mmap.c Sat Apr 21 18:30:48 2012 (r234555)
+++ head/sys/vm/vm_mmap.c Sat Apr 21 18:36:53 2012 (r234556)
@@ -1561,9 +1561,11 @@ vm_mmap(vm_map_t map, vm_offset_t *addr,
* If the process has requested that all future mappings
* be wired, then heed this.
*/
- if (map->flags & MAP_WIREFUTURE)
+ if (map->flags & MAP_WIREFUTURE) {
vm_map_wire(map, *addr, *addr + size,
- VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES);
+ VM_MAP_WIRE_USER | ((flags & MAP_STACK) ?
+ VM_MAP_WIRE_HOLESOK : VM_MAP_WIRE_NOHOLES));
+ }
} else {
/*
* If this mapping was accounted for in the vnode's
More information about the svn-src-head
mailing list