LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Why can't more processors use more RAM? (https://www.linuxquestions.org/questions/linux-hardware-18/why-cant-more-processors-use-more-ram-924056/)

Zssfssz 01-16-2012 11:19 AM

Why can't more processors use more RAM?
 
Let's say I have a 32bit computer with 2 Physical (Not-Logical) CPUs. Why can't each processor acsess 4 gigs of RAM? (Total of 8) Why does it top out at 4gigs not depending how many processors there are? Doesnt each prossesor have a ESP register (that is the one that handles ram right?)?

business_kid 01-16-2012 11:29 AM

I don't think anything has a logical cpu - they are called cores.

Think about it . . .

johnsfine 01-16-2012 11:38 AM

Quote:

Originally Posted by Zssfssz (Post 4575983)
Let's say I have a 32bit computer with 2 Physical (Not-Logical) CPUs. Why can't each processor acsess 4 gigs of RAM? (Total of 8) Why does it top out at 4gigs not depending how many processors there are? Doesnt each prossesor have a ESP register (that is the one that handles ram right?)?

If the motherboard supports more than 4GB of ram then even one 32 bit processor can use more than 4GB of ram. You just need a PAE build of the Linux kernel.

In almost all x86 multiprocessor designs, all processors share the same physical address for ram, so there is no reason for more processors to be either necessary or sufficient for accessing more ram.

The ESP register is the 32 bit stack pointer. I have no idea what you think you mean by "the one that handles ram". But whatever that means, you are confused.

In a 32 bit "flat" memory architecture (such as that used by both Linux and Windows in 32 bit x86) every address is mapped from a 4GB virtual address space into whatever size physical address space is supported by that system, which might be up to 64GB.
Each process has a different mapping, so multiple processes can use more than 4GB of physical memory.

The translation layer skips the low 12 bits of the virtual/physical address, so there is not even any inconvenience of using 32 bit registers for setting up the PAE mapping data. The PAE version of mapping maps the 20 high bits of a 32 bit virtual address to the 24 high bits of a 36 bit physical address. In a properly modularized OS, only a tiny part of the kernel needs to be aware of the physical address size. Windows is not well modularized, so many drivers need to be aware of the physical address size and only support 4GB, so the ordinary version of 32 bit XP supported only 3 and a fraction GB of ram even when PAE was turned on. 32 bit windows support for 4GB or more of ram was restricted by a special license and restricted in which devices had working drivers.

Zssfssz 01-16-2012 11:39 AM

Intel had/has this 'Hyper Threading Technology' introduced sometime in the late pentiums. It allowed a single CPU to act as two logical CPUs, I think they have improved on it to increase the number of logical CPUs.
Oh you where talking about the word... Windows, Wikipedia, Intel, they all called it logical CPUs.
Back to the question.

jefro 01-16-2012 11:55 AM

If you have a 32 bit dual processor, then it is pretty old. The motherboard chipset most likely is the issue but in any case you have to have pae and a supported smp version that would allow that.

Not sure I have known how to implement pae in smp.

Zssfssz 01-16-2012 12:31 PM

Ohh, I installed a PAE kernel thinking that ment it was an update, or just a Meta-Package; I had no idea that's what it did!
So what I gather from that is that PAE can address more RAM. If that's the case then why don't distros like Ubuntu use the PAE version as their default?

johnsfine 01-16-2012 01:12 PM

Quote:

Originally Posted by Zssfssz (Post 4576044)
If that's the case then why don't distros like Ubuntu use the PAE version as their default?

I think most people with 4GB or more ram on a Linux system use or should use a 64 bit version of Linux.

There are various tiny overheads to each of PAE and 64-bit compared to non-PAE 32-bit (extra time on each TLB miss, extra kernel code size, extra memory mapping table size). Those normally don't add up to enough for anyone to worry about, but if you have a 32 bit system with too little ram to need PAE, why should a distribution default to including even tiny overhead that you don't need.

If you have a slightly older 32 bit CPU the performance differences of TLB misses will be a larger fraction of total performance. If you have a much older 32 bit CPU, a PAE kernel won't work at all.

If you have extremely little ram, the small difference in kernel code size and memory table size may matter.

Most distributions default to including SMP support in every kernel, even though many users have single thread hardware. That also adds some tiny overhead in kernel code size and performance. But at least the SMP kernel doesn't fail on a system with no hardware support for SMP the way a PAE kernel fails on a system with too old a 32 bit CPU.

The distribution needs to make their best estimate of what will be acceptable for a lot of users: SMP whether you need it or not, PAE typically only is you install the PAE package to replace the default kernel, other kernel build options no pre built choice at all.
If you want a kernel exactly to your specifications, Linux is open source so you can compile your own.

jthill 01-16-2012 03:25 PM

Let me give an answer I haven't seen yet to the initial question: the two cpus must share access to the same memory because if they did not, they would not be able to copy directly from one to another (because neither could access the other's), and so would have to effectively communicate across a network link, and you'd have a distributed-system-in-a-box not a dual-cpu system. Other issues come into play as well, if you want a taste there's the WP article on single-image systems.


All times are GMT -5. The time now is 11:46 AM.