Re: [rfc] no ZERO_PAGE?

Hugh Dickins
2007-04-04T15:03:15Z

On Wed, 4 Apr 2007, Dan Aloni wrote:
>
> To refine that example, you could replace the file with a large anonymous
> memory pool and a lot of swap space committed to it. In that case - with
> no ZERO_PAGE, would the kernel needlessly swap-out the zeroed pages?
> Perhaps it's an example too far-fetched to worth considering...

Nice point, not far-fetched, though I don't know whether it's worth
worrying about or not. Yes, as things stand, the kernel will
needlessly write them out to swap: because we're in the habit of
marking a writable pte as dirty, partly to save the processor (how
i386-centric am I being?) from having to do that work just after,
partly because of some race too ancient for me to know anything
about - do_no_page (though not the function in question here) says:

* This silly early PAGE_DIRTY setting removes a race
* due to the bad i386 page protection. But it's valid
* for other architectures too.

Maybe Nick will decide to not to mark the readfaults as dirty.

Hugh