Date: Mon, 12 Feb 1996 08:10:57 +0000 () From: "John S. Dyson" <toor@dyson.iquest.net> To: luigi@labinfo.iet.unipi.it (Luigi Rizzo) Cc: dufault@hda.com, hackers@FreeBSD.ORG Subject: Re: Zero Fill On Demand (was Re: Compressed RAM/SWAP) Message-ID: <199602120810.IAA02460@dyson.iquest.net> In-Reply-To: <199602120827.JAA00762@labinfo.iet.unipi.it> from "Luigi Rizzo" at Feb 12, 96 09:27:17 am
next in thread | previous in thread | raw e-mail | index | archive | help
> > > > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602120810.IAA02460>