Subject: Re: UVM optimalisations / remarks
To: None <tech-kern@netbsd.org>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 03/17/2002 11:34:21
hi,
while it would be possible to optimize for applications which read from but
don't write to zero-fill memory, or write only zeroes to zero-fill memory,
that would greatly reduce the performance of all real applications.
real applications invariably write non-zero values to memory that they
allocate, so optimizing for this case is preferred.
-Chuck
On Sun, Mar 17, 2002 at 07:31:00PM +0100, Reinoud Zandijk wrote:
> Dear all,
>
> just reading the UVM dissitation and I noted the following remark om page
> 11 :
>
> ``This (backing object for a page) is usually a file or `zero-fill' memory
> wich means that the area should be filled with zeroed memeory as its
> accessed. (....) For zero-fill memory, the copy-on-write flag doesn't
> matter''
>
> I disagree with this ... why shouldn't zero filled memory be backed with
> just *one* by all processes shared R/O page when it faults for reading that
> uses copy-on-write to get a private one if something changed ?
>
> Is this allready done in UVM ? or is it explained later on ? seems spilling
> pages otherwise.... if a process would only just _READ_ that memory it
> would get heaps of zeroed memory pages ... where it could be just one zero
> page it reads over and over again ... writing one of the pages then gives a
> new fresh page for its modifications.
>
> I dont know how our `calloc' works but maybe that could be integrated too ?
> since you _know_ that those pages are zero anyway.
>
> A further optimalisation could even be to check if the page is zero still
> and rename that page to the anonymous _one_ page when memory gets tight ...
>
> Cheers,
> Reinoud
>
> (trying to understand UVM/pmap better)