Date: Thu, 17 Feb 2000 04:05:55 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Jason Evans <jasone@canonware.com>, current@FreeBSD.ORG Subject: tentitive complete patch for MAP_GUARDED available Message-ID: <200002171205.EAA58472@apollo.backplane.com>
next in thread | raw e-mail | index | archive | help
    This is *NOT* a commit candidate yet (and definitely not until
    after release).  It's only tentitive... I had to rip up some core 
    pieces to get the kernel to properly optimize vm_map_entry
    structures for the downward-generated-stacks.
	http://www.backplane.com/FreeBSD4/
	http://www.backplane.com/FreeBSD4/guard-2.diff
	http://www.backplane.com/FreeBSD4/guard2.c
    With this patch it should be possible to trivially modify 
    the threads code.  You pretty much keep what you have except
    use MAP_GUARDED|MAP_STACK, and deal with skipping over the guard 
    pages.  
    Resource limits are still an issue.  It turns out that the
    MAP_STACK code does not deal with the stack resource limit
    well at all -- sometimes it catches it, sometimes it doesn't.
    At the moment MAP_GUARDED doesn't even try but that does not
    prevent you from using the stack memory areas to do your mmaps.
    You can use MAP_GUARDED|MAP_STACK now.  This is effectively
    MAP_GUARDED but will cause the mmap() to fail if you specify
    a fixed address that already contains mappings (which is what 
    you want, I think).  i.e. that is what MAP_STACK semantics
    normally do - return a failure on a conflict.
    There are probably bugs, much more testing is necessary.
					-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?200002171205.EAA58472>
