From owner-freebsd-hackers@FreeBSD.ORG Tue Sep 9 21:58:05 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 14E5516A4BF for ; Tue, 9 Sep 2003 21:58:05 -0700 (PDT) Received: from web13404.mail.yahoo.com (web13404.mail.yahoo.com [216.136.175.62]) by mx1.FreeBSD.org (Postfix) with SMTP id 9A01E43FE1 for ; Tue, 9 Sep 2003 21:58:04 -0700 (PDT) (envelope-from giffunip@yahoo.com) Message-ID: <20030910045803.1892.qmail@web13404.mail.yahoo.com> Received: from [200.91.194.237] by web13404.mail.yahoo.com via HTTP; Tue, 09 Sep 2003 21:58:03 PDT Date: Tue, 9 Sep 2003 21:58:03 -0700 (PDT) From: "Pedro F. Giffuni" To: freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: FYI: NetBSD mmap Improvements X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Sep 2003 04:58:05 -0000 taken from wine HQ: http://www.winehq.com/?issue=186#NetBSD mmap Improvements "On NetBSD (upcoming 1.6.2, and 1.7/2.0-current), there is a new extension flag MAP_TRYFIXED that essentially simulates current Linux mmap behavior: try the mmap() hint first, without clobbering mapped pages, even if the hint falls within traditionally "protected" malloc heap space. If the fixed mapping fails, the block is still mapped at a relocated address, as if mmap were called with no flags set. With this patch, mmapping PE files on NetBSD becomes an order of magnitude faster, as the vfork()-and-mincore() silly walk is avoided altogether. I've implemented the patch as forward-looking, allowing other platforms to add MAP_TRYFIXED to gain the same benefit. (This mmap flag name does not appear to be used in any divergent fashion on any other platform, per my research when picking the flag's name.) " __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com