Date: Fri, 18 Feb 2000 15:59:15 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: alc@cs.rice.edu, current@FreeBSD.ORG Subject: Re: tentitive complete patch for MAP_GUARDED available Message-ID: <200002182359.PAA81991@apollo.backplane.com> References: <200002182141.QAA18866@pcnet1.pcnet.com> <200002182209.OAA81369@apollo.backplane.com> <200002182304.PAA81713@apollo.backplane.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Ok, this time for sure... version 3 of the MAP_GUARDED patch is out.
http://www.backplane.com/FreeBSD4/
http://www.backplane.com/FreeBSD4/guard-3.diff
http://www.backplane.com/FreeBSD4/guard3.c
MAP_GUARDED
mmap(addr/NULL, len, prot, MAP_GUARDED, fd, offset)
The offset field specifies the number of bytes at the base of the
returned map which are guarded and should be a multiple of the
system page size.
Pages at the end of the map are not guarded (any more).
MAP_STACK
Works as per normal except that the per-process stack resource limit
applies to each mmap() separately.
MAP_GUARDED|MAP_STACK
Useful combination to place guard page(s) at the beginning of a
thread stack.
Also in this patch set I optimized vm_map_entry creation during normal
stack growth operations. Normally the system tries to chunk vm_map_entry
allocation for stacks by SGROWSIZ, which is typically 128K. But
now the vm_map_entry_insert() optimization is able to optimize standard
stack growth, which means that the actual vm_map_entry creation is
governed by the more generous vm.map_entry_blk_opt value (512K by default).
I like this implementation a lot better. By removing the guard pages at
the end of the map MAP_GUARDED|MAP_STACK operation is much, much more
intuitive. You don't have to do a blessed thing to the threading code
except change MAP_STACK to MAP_STACK|MAP_GUARDED, and bump up the size
of the mmap() allocation to include what used to be the skipped 'dead'
page.
-Matt
Matthew Dillon
<dillon@backplane.com>
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002182359.PAA81991>
