From owner-freebsd-hackers Mon Jan 6 14:45:00 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id OAA06437 for hackers-outgoing; Mon, 6 Jan 1997 14:45:00 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.8.4/8.8.4) with SMTP id OAA06427 for ; Mon, 6 Jan 1997 14:44:50 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id PAA12791; Mon, 6 Jan 1997 15:35:13 -0700 From: Terry Lambert Message-Id: <199701062235.PAA12791@phaeton.artisoft.com> Subject: Re: MMAP Troubles (Joerg?) To: joerg_wunsch@uriah.heep.sax.de Date: Mon, 6 Jan 1997 15:35:12 -0700 (MST) Cc: freebsd-hackers@FreeBSD.ORG, henrich@crh.cl.msu.edu In-Reply-To: from "J Wunsch" at Jan 4, 97 11:43:34 am 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 > > I have an oppourtunity for the MMAP person (Appears to be Joerg by > > the .c, but cant tell for sure :) > > Certainly not me, rather John Dyson. But doesn't matter. > > > Anyway, I have a big beefy pentium pro system here for use as news > > that im going to roll out in a few weeks. INN w/ MMAP causes the > > NULL trashed active file, interested in working on the problem with > > a system at your beck and call? > > IIRC, the last word on INN w/ mmap() was that INN uses mmap() against > the specs in that it tries to shorten (or extend) the file while it's > being mmap()'ed. This only incidentally works on SysV's. > > All this is hearsay, so maybe John or somebody else will tell you more > exactly. Rather, it "doen't fail on non-unified cache machines"... basically because a fault causes a copy (remember bmap()?) and the backing store for the mapped region is one type of cache and the backing store for the vnode is another... It "fails" on FreeBSD because when the file is extended, a partial page is generated, but since the mapping can only go in jumps of full pages, the difference between the previous end of file and the next page boundry is now screwed beyond recognition. This is especially the case if it was using a frag for the last partial page (the use of an 8 bit 512 byte bitmap for partial pages has been discussed; however, this is not a generic soloution; for instance, a 68040 machine with an 8k page size and a 512 byte disk block size would show the errors again when a 512k on an odd 1K boundry were added to the mappable region). Part of the "fix" is to provide a mechanism for device/offset instead of vnode/offset caching, then use the device/offset for mmap instead of referencing the buffers out of the vnode. Alternately, the extention operation must change the mapping, expanding the in core buffer from the prvious fragmentary validity to the page boundry. Ideally, we could pass a "-1" or "0" or som othe magic number in to indicate that the mapping should be dynamically expanded, if possible. Of course INN doesn't use it this way... This has really been discussed to death... INN's assumptions are invalid; for historical compatability, BSD should probably validate the assumptions by going through the extra motions on a file extend, but it currently does not do so. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.