From owner-freebsd-fs Wed Sep 20 0:12:59 2000 Delivered-To: freebsd-fs@freebsd.org Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (Postfix) with ESMTP id 81DAA37B423 for ; Wed, 20 Sep 2000 00:12:57 -0700 (PDT) Received: (from daemon@localhost) by smtp01.primenet.com (8.9.3/8.9.3) id AAA13826; Wed, 20 Sep 2000 00:12:13 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp01.primenet.com, id smtpdAAA_dai5A; Wed Sep 20 00:12:03 2000 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id AAA00357; Wed, 20 Sep 2000 00:12:38 -0700 (MST) From: Terry Lambert Message-Id: <200009200712.AAA00357@usr05.primenet.com> Subject: Re: how mmap buffer writes handled? To: mbendiks@eunet.no (Marius Bendiksen) Date: Wed, 20 Sep 2000 07:12:37 +0000 (GMT) Cc: tlambert@primenet.com (Terry Lambert), stein@eecs.harvard.edu (Christopher Stein), freebsd-fs@FreeBSD.ORG In-Reply-To: from "Marius Bendiksen" at Sep 20, 2000 09:04:32 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > > use some of the protection facilities or such to force an exception to be > > > raised when accessing the page for write, and updating the statistics > > > based on that. > > as being dirty. If you look at the VM code, you will see that > > the page is actually mapped elsewhere, and the page not present > > fault is trapped, and then looked up in a translation table, 8-p. > > Indeed, so it does. But why would we have code to handle this on i386? Per my original post, the reason is that a kernel write fault, such as might happen as the result of a file read into an address in an mmap()'ed area, will fail to cause the page in question to be marked dirty, without this hack, and VM coherency will fail to be maintained. Failure of VM coherency is bad. > (PS: The method you mentioned would still qualify as "force an exception > to be raised when accessing the page for write" ;) Actually, not. It's on the order of the F00F bug fix, which is a gross kludge of the worst sort. The page being written doesn't exist. It's a non-existance exception, not an access exception, since if the page mapping existed, it wouldn't result in the exception in the first place. 8-). Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message