Page 2 of 2

Re: Insanely large C++ binary. Bad linking to blame ?

Posted: Mon May 03, 2010 12:09 pm
by Neolander
Selenic wrote:@Neolander: You *can* mix together different page sizes, you know.
No, I didn't know, you're learning me something new here ;) When reading Modern Operating Systems (my main reference book), I basically assumed that there could only be one kind of page, with the OS having the right to change its size based on hardware capabilities and that's all.
I did not take the time to fully read all details in AMD manuals at the moment. I can't read big books (> 20 pages) on a computer screen, I need a hard copy for that, otherwise all I can do is open the PDF, search something, reads some pages around it, and close the pdf.

Sadly, I couldn't find out how to get a hard copy of AMD manuals on their site. And Intel stopped editing hard copies of their manuals, so it's not an option anymore.
Also, in some cases, you have large data structures that are never paged (ie, they're generated in memory), in which case you get the advantages of larger pages without the main disadvantage.
How do I access those if they aren't paged and I have paging enabled ? Is there a way other than identity mapping, except keeping enabling/disabling paging ?

Re: Insanely large C++ binary. Bad linking to blame ?

Posted: Tue May 04, 2010 10:35 am
by Selenic
Neolander wrote:
Selenic wrote:@Neolander: You *can* mix together different page sizes, you know.
No, I didn't know, you're learning me something new here ;) When reading Modern Operating Systems (my main reference book), I basically assumed that there could only be one kind of page, with the OS having the right to change its size based on hardware capabilities and that's all.
Basically, in the page directory there's a bit which indicates whether what it points at is a page table with 512*4K entries or a 2M page. Similar at the next level up if you're using 1G pages. The wiki page on Paging tells you how to do this in 32-bit non-PAE mode; the same bit (bit 7) is used in other paging modes for the same purpose.
Neolander wrote:
Also, in some cases, you have large data structures that are never paged (ie, they're generated in memory), in which case you get the advantages of larger pages without the main disadvantage.
How do I access those if they aren't paged and I have paging enabled ? Is there a way other than identity mapping, except keeping enabling/disabling paging ?
Sorry, that's me not being clear. I meant it's never paged out to disk. It would still be mapped into memory in the usual way.