From owner-freebsd-hackers Mon Feb 12 05:15:36 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id FAA29132 for hackers-outgoing; Mon, 12 Feb 1996 05:15:36 -0800 (PST) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id FAA29127 for ; Mon, 12 Feb 1996 05:15:33 -0800 (PST) Received: (from root@localhost) by dyson.iquest.net (8.6.11/8.6.9) id IAA02460; Mon, 12 Feb 1996 08:10:58 GMT From: "John S. Dyson" Message-Id: <199602120810.IAA02460@dyson.iquest.net> Subject: Re: Zero Fill On Demand (was Re: Compressed RAM/SWAP) To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Date: Mon, 12 Feb 1996 08:10:57 +0000 () Cc: dufault@hda.com, hackers@FreeBSD.ORG In-Reply-To: <199602120827.JAA00762@labinfo.iet.unipi.it> from "Luigi Rizzo" at Feb 12, 96 09:27:17 am X-Mailer: ELM [version 2.4 PL24 ME8] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.ORG Precedence: bulk > > > > If there are lots of zero'd pages that aren't used that often, > > > can't be eliminated, and would benefit from compression wouldn't > > > it be better to look at a ZFOD (zero fill on demand) mechanism? > > > > Perhaps using that as a HINT as to which pages might be useful targets > > for compression??? Maybe eliminating the wasteful attempted compression. > > One possible way to achieve ZFOD would be the following: > > + make sure that there is always a bzeroed page, say ZP > + when creating a new page, just build a copy-on-write reference to ZP > in the page table. > > this should be quite fast at creation (and implementation) time, > and a bit more powerful than ZFOD, as the page is read-accessible > from the beginning without any page fault. > It is easy to put pages into a process at the time that it is put into a process address space, but if you run the lat_mmap benchmark, you notice that it does take finite time. All in all it is a performance boost though, but how much?. > > I believe it is going to be more expensive when the page is written > to, because copying require twice the accesses of bzero-ing. > If the page is written to, the fault will occur before the write. So a copy is not needed, but a new zero page still needs to be grabbed from the zero page queue. (There is an page zeroing mechanism at idle time.) Note that pages that are non-COW, r/w are placed r/w into address space at fault time even though they might be read first. Lemme think about your idea a little longer. John