From owner-freebsd-hackers Thu May 15 11:46:40 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA06887 for hackers-outgoing; Thu, 15 May 1997 11:46:40 -0700 (PDT) Received: from caipfs.rutgers.edu (root@caipfs.rutgers.edu [128.6.155.100]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA06877 for ; Thu, 15 May 1997 11:46:19 -0700 (PDT) Received: from jenolan.caipgeneral (jenolan.rutgers.edu [128.6.111.5]) by caipfs.rutgers.edu (8.8.5/8.8.5) with SMTP id OAA21704; Thu, 15 May 1997 14:46:05 -0400 (EDT) Received: by jenolan.caipgeneral (SMI-8.6/SMI-SVR4) id OAA01311; Thu, 15 May 1997 14:44:33 -0400 Date: Thu, 15 May 1997 14:44:33 -0400 Message-Id: <199705151844.OAA01311@jenolan.caipgeneral> From: "David S. Miller" To: terry@lambert.org CC: terry@lambert.org, ejc@bazzle.com, james@westongold.com, freebsd-hackers@FreeBSD.ORG In-reply-to: <199705151821.LAA15353@phaeton.artisoft.com> (message from Terry Lambert on Thu, 15 May 1997 11:21:25 -0700 (MST)) Subject: Re: mmap() Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk From: Terry Lambert Date: Thu, 15 May 1997 11:21:25 -0700 (MST) 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. The one I have made reference to only requires a small learning prefetch tree to be hung off the vnode, after you acquire a certain amount of "learning codes" you just chuck the entire tree and begin learning again (this guarentees that bad sequence code selections eventually get kicked out, it also limits how much space your learning tree can ever take up). 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). Solaris and IRIX both do something remotely like this, it's a very old idea but can be applied to existing binary formats like ELF. (one thing they do is they assign a "probably gonna mmap() is here" address to every single shared library, and they distribute the address space as evenly as they can amongst these libraries, thus they pre-relocate all the symbols assuming this address, then when a program maps it in they try hard to use the pre-relocated address, they even do this for what will be the anonymous mapped bss section for the library). Solaris has even better tricks where they collapse all the symbols you actually have referenced in a shared library into one spot, so for example if you only reference printf(), write(), and read(), those three libc calls get collapsed into one page. It's a tlb/cache miss prevention thing, but the implementation is a bitch. Solaris also has symbol versioning, a very powerful concept to prevent having to make old interfaces obsolete in a new libc release for example, we support this particular facility under Linux (although in a more powerful form, Solaris got the concept right but they fucked up a lot of the important details, making they symbol versioning pretty much useless in numerous important cases). 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. Patented does not mean the idea is not usable, you can only patent a specific implementation, just change one of the variables in the implementation (in the case of the prefetching algorithm I referenced, just change the compression code scheme to some other one which is just as suitable) and you're safe. ---------------------------------------------//// Yow! 11.26 MB/s remote host TCP bandwidth & //// 199 usec remote TCP latency over 100Mb/s //// ethernet. Beat that! //// -----------------------------------------////__________ o David S. Miller, davem@caip.rutgers.edu /_____________/ / // /_/ ><