From owner-freebsd-current Thu Feb 17 4: 5:58 2000 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 4060637B678 for ; Thu, 17 Feb 2000 04:05:56 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id EAA58472; Thu, 17 Feb 2000 04:05:55 -0800 (PST) (envelope-from dillon) Date: Thu, 17 Feb 2000 04:05:55 -0800 (PST) From: Matthew Dillon Message-Id: <200002171205.EAA58472@apollo.backplane.com> To: Jason Evans , current@FreeBSD.ORG Subject: tentitive complete patch for MAP_GUARDED available Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message