LWN.net Logo

Adding a huge zero page

Adding a huge zero page

Posted Sep 27, 2012 7:00 UTC (Thu) by smurf (subscriber, #17840)
In reply to: Adding a huge zero page by mti
Parent article: Adding a huge zero page

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.


(Log in to post comments)

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.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds