Built in ram limit for 64 bit

Hey all,

I have been thinking about getting a new computer, and the motherboard I am looking at is capable of holding up to 8 Gb of ram. Now it appears as though for 32 bit linux, in order to use more than 4 Gb of ram, you had to enable a certain option in the kernel, but if I remember correctly, there was also a performance hit for doing so. Of course I will be going 64 bit, and so I am wondering if there will be any problems with > 4 Gb of ram? Or will Linux take care of everything in 64 bit mode?

I don't have any experience with x86_64 cpu's and I have never used more than 2 GB Ram on any pc. But after reviewing the memory management sections of my copy "Understanding the Linux Kernel", I may have a handle on this. The Linux kernel needs to use a CPU feature called PAE to access more than 4GB of memory with a 32 bit kernel. This pushes the paging system into a 3 level model (instead of a 2 level model) resulting in the performance hit you mentioned. A 64 bit kernel needs a 3 level model up to kernel version 2.6.10. But this imposed constraints on how memory could be allocated. Starting with version 2.6.11, a four level paging model is used with x86_64 cpu's. It is not clear from the book if it would be possible to not use PAE on a x86_64 with 4 GB or less of memory. But reading between the lines a bit, I gather that the answer is "no". Support for non-PAE kernels seems to be intended for very old cpu's and they won't do 64 bit. Besides large RAM configurations, PAE is required to use the new NX flag which marks some memory regions as non-executable. This closes a security problem. Linux 2.6.11 supports the NX feature.

So a 64-bit kernel may have less decisions for you to make thus "taking care of things".

Ok, thanks - this confirms my suspicions. When poking around in my kernel config (kernel 2.6.20) I could not seem to find any option for large memory support anyway, whereas I do remember seeing it a while back, so that must have been a 2.6.10 or earlier kernel as you mentioned.