Posted Sep 27, 2012 7:00 UTC (Thu) by smurf (subscriber, #17840)
[Link]
Because the whole point is to save a layer of page translations. You can't, when you do get a page fault, go back a layer and check whether all of the other pages referenced by that layer all point to the (small) zero page.
That would kill more performance than you gain by huge pages in the first plale.
Adding a huge zero page
Posted Sep 27, 2012 7:32 UTC (Thu) by mti (subscriber, #5390)
[Link]
It would be easy mark this small zero page as beeing part of what really should have been a huge zero page. (One way would be to have two small zero pages, the old one and a new special one that is only used as a substitute for the huge zero page.)
My thinking is that this unintialized memory is not really read much until the first write so it is not performance critical. That assumption may of course be wrong. Btw, what programs are reading unintialized memory and why?
But on the other hand, if there is a lot of reading of this zeroed memory, wouldn't a single small page fit better in the cache, thus improving preformance?
Adding a huge zero page
Posted Sep 27, 2012 8:07 UTC (Thu) by justincormack (subscriber, #70439)
[Link]
Given everyone knows it is zero, probably not that much reading, other than for programs using it as a sparse data structure I guess.
Adding a huge zero page
Posted Sep 27, 2012 9:07 UTC (Thu) by kiryl (subscriber, #41516)
[Link]
H. Peter Anvin asked to evaluate other implementation: virtual huge zero page. The idea to have pmd table where all entires point to normal zero page. This way should be more effective from cache usage point of view, but it will increase pressure on TLB. I'm going to implement it and compare with current implementation.
Adding a huge zero page
Posted Oct 12, 2012 11:51 UTC (Fri) by etienne (subscriber, #25256)
[Link]
Sorry, late comment.
Shortening a huge zero page is good from the cache point of view, but maybe bad from DMA point of view, a:
dd if=/dev/zero of=/dev/sda18
may be forced to use 4 Kbytes pages because the huge zero page is not contiguous in physical memory...
Just my £0.02