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 
                                        <[EMAIL PROTECTED]>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to