Date: Sat, 21 Apr 2012 18:36:53 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r234556 - head/sys/vm Message-ID: <201204211836.q3LIarcY000195@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204211836.q3LIarcY000195>