From owner-freebsd-hackers Thu May 15 11:28:44 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA05859 for hackers-outgoing; Thu, 15 May 1997 11:28:44 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id LAA05853 for ; Thu, 15 May 1997 11:28:41 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id LAA15353; Thu, 15 May 1997 11:21:25 -0700 From: Terry Lambert Message-Id: <199705151821.LAA15353@phaeton.artisoft.com> Subject: Re: mmap() To: davem@jenolan.rutgers.edu (David S. Miller) Date: Thu, 15 May 1997 11:21:25 -0700 (MST) Cc: terry@lambert.org, ejc@bazzle.com, james@westongold.com, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199705151810.OAA01276@jenolan.caipgeneral> from "David S. Miller" at May 15, 97 02:10:28 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > This is not to say the situation is hopeless; you *could* crank up > the sequential I/O performance of mmap(), at a cost of a save and > compare in the general page fault case. > > Or you could add intelligent page prefetching/prefaulting, see the > JACM article on prefetching about 3 or 4 issues ago for an extremely > clever strategy to pull this off in an online fashion. > > Although be careful, their scheme is patented, but you could implement > something similar just using something other than LNZ compression code > selection (ie. use another compression scheme's code selection). > There is proof even in the computer learning field that this is an > extremely effective limited history prefetching strategy. Yes; the store was for "last page" and the compare was for "this page equal last page plus one" to add a prefetch trigger to the VM to enable predictive faulting. The intelligent mechanisms generally require a history with the file; The ICON systems (which used a seperate processor for the disk controller subsystems) kept a bitmap of this information to decide which pages were probably going to be asked for, and faulted them in. I think that predictive faulting in the mmap() case should be as valuable as predictive read-ahead (faulting, basically) in the read() case, though I admit that it would be interesting to investigate more intelligent algorithms. The University of Utah, in particular, had a very interesting project which involved keeping around pieces of prelinked PIC objects, which was effectively "faulting" object linking for shared libraries. They unfortunately required you to do bizarre things with your address space (I considered it as a potential candidate for BSD shared libraries at one time). I seems to me that the cache criteria algorithm from this would be a good method for intelligent page selection... it's basically the same thing, applied to code usage rather than data usage of the page contents, and the bonus is that it's published instead of patented. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.