LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-24-2009, 11:04 AM   #1
kingheart
LQ Newbie
 
Registered: Apr 2009
Posts: 4

Rep: Reputation: 0
What is Max. memory for x64 PCs ?


32-bit OS(all OS including Linux and windows) has a limit to directly allocte up to 4GB memory. But what is the max. derectly allocable memory limit for 64-bit ?
directly means without any software help.(PAE,AWE?!)
can you provide more info about 64-bit memory allocation?
 
Old 04-24-2009, 11:24 AM   #2
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,299
Blog Entries: 61

Rep: Reputation: Disabled
According to Wikipedia:
Quote:
17.2 billion gigabytes, 16.8 million terabytes, or 16 exabytes of RAM.
= a lot.
 
Old 04-24-2009, 11:25 AM   #3
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
See http://en.wikipedia.org/wiki/64_bit.
 
Old 04-24-2009, 11:43 AM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by kingheart View Post
32-bit OS(all OS including Linux and windows) has a limit to directly allocte up to 4GB memory. But what is the max. derectly allocable memory limit for 64-bit ?
directly means without any software help.(PAE,AWE?!)
can you provide more info about 64-bit memory allocation?
Saying "allocate" when you otherwise seem to mean "address" confuses the question. Maybe you don't mean "address", but I don't think anyone understands what you mean by "allocate".

It's also strange to call PAE "software help". PAE is a CPU feature in all recent CPUs that can run 32bit x86 kernels (some very old CPUs don't have it).

If you are asking how much virtual memory a a process can directly address, 4GB is correct for 32 bit and PAE is irrelevant.

If you are asking how much physical memory a kernel can give (in total) to multiple processes, PAE should not be ignored. PAE isn't some weird kludge. It is a direct subset of the memory mapping required by 64 bit. The people who say you should use a 64 bit kernel for over 4GB physical to avoid the overhead of PAE completely misunderstand the structure. All the overhead (plus some more) of PAE is in the standard 64bit mapping system. It just isn't called "PAE".

Quote:
Originally Posted by brianL View Post
17.2 billion gigabytes, 16.8 million terabytes, or 16 exabytes of RAM.
That is a missleading answer. Some hypothetical 64 architecture could support 16 exabytes of virtual memory (64 bit addressing) but the current x86-64 architecture can't (I don't think any other 64 bit architecture can either). The x86-64 architecture only supports 48 bit addressing (256 terabytes, with half of that typically reserved for the kernel).

Someday there may be a next version of the x86-64 architecture that supports more than 256 terabytes virtual, but actually using that would require a significantly bigger change to OS kernels than the change that was needed to 32 bit kernels to support PAE. It would be a pointless argument in semantics whether you would call that the "same architecture". The practical difference is that you couldn't use it with the same OS kernel. Similar to 32-bit with/without PAE, most of the difference is hidden from the application programs, so an application that is limited to 128 Terabytes on some OS without that new feature might have use of more than that on some new OS for that hypothetical "new" architecture, without even recompiling the application.

Last edited by johnsfine; 04-24-2009 at 11:55 AM.
 
Old 04-24-2009, 11:47 AM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
I opened a big number calculator applet and entered 2^64-1. The result is 18,446,744,073,709,551,615. Like brianL says, that's a lot.
 
Old 04-24-2009, 11:47 AM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by brianL View Post
According to Wikipedia:

17.2 billion gigabytes, 16.8 million terabytes, or 16 exabytes of RAM.

= a lot.
Quote:
Originally Posted by Quakeboy02 View Post
I opened a big number calculator applet and entered 2^64-1. The result is 18,446,744,073,709,551,615. Like brianL says, that's a lot.
Well, note that that number is currently "theoretical", so far the implementation doesn't live up:
http://en.wikipedia.org/wiki/Amd64#V..._space_details

Quote:
Although virtual addresses are 64 bits wide in 64-bit mode, current implementations (and any chips known to be in the planning stages) do not allow the entire virtual address space of 16 EB (18,446,744,073,709,551,616 bytes) to be used. Most operating systems and applications will not need such a large address space for the foreseeable future (for example, Windows implementations for AMD64 are only populating 16 TB (17,592,186,044,416 bytes), or 44 bits' worth), so implementing such wide virtual addresses would simply increase the complexity and cost of address translation with no real benefit. AMD therefore decided that, in the first implementations of the architecture, only the least significant 48 bits of a virtual address would actually be used in address translation (page table lookup). However, bits 48 through 63 of any virtual address must be copies of bit 47 (in a manner akin to sign extension), or the processor will raise an exception. Addresses complying with this rule are referred to as "canonical form." Canonical form addresses run from 0 through 00007FFF`FFFFFFFF, and from FFFF8000`00000000 through FFFFFFFF`FFFFFFFF, for a total of 256 TB (281,474,976,710,656 bytes) of usable virtual address space.

Last edited by H_TeXMeX_H; 04-24-2009 at 11:49 AM.
 
Old 04-24-2009, 12:13 PM   #7
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Thanks for the update TexMex, but I'm a bit concerned about the wording of that quote. They are calling it a "virtual address space". I don't think this is correct; maybe john will chime in and correct me. But, to me, 64 bits is 64 bits, and there's nothing virtual about it, assuming the hardware is actually there. OTOH, who knows when the first real 64-bit CPU/motherboard will be sold, if ever.
 
Old 04-24-2009, 12:24 PM   #8
kingheart
LQ Newbie
 
Registered: Apr 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thsnks To johnsfine To correct some problems and all who answered. now i understand why different OS gives different answer.it is clear from last answer.

Special thanks to H_TeXMeX_H
 
Old 04-24-2009, 12:31 PM   #9
kingheart
LQ Newbie
 
Registered: Apr 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Can you discuss this further? anyone?

Quote:
Originally Posted by Quakeboy02 View Post
Thanks for the update TexMex, but I'm a bit concerned about the wording of that quote. They are calling it a "virtual address space". I don't think this is correct; maybe john will chime in and correct me. But, to me, 64 bits is 64 bits, and there's nothing virtual about it, assuming the hardware is actually there. OTOH, who knows when the first real 64-bit CPU/motherboard will be sold, if ever.
Can you discuss this further? anyone? i am interested about this quote
 
Old 04-24-2009, 12:58 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by Quakeboy02 View Post
Thanks for the update TexMex, but I'm a bit concerned about the wording of that quote. They are calling it a "virtual address space". I don't think this is correct; maybe john will chime in and correct me. But, to me, 64 bits is 64 bits, and there's nothing virtual about it, assuming the hardware is actually there. OTOH, who knows when the first real 64-bit CPU/motherboard will be sold, if ever.
That's a good question, I think this image sums it up:
http://commons.wikimedia.org/wiki/Fi...lationship.svg

Or just take the definition here:
Quote:
Virtual memory is a computer system technique which gives an application program the impression that it has contiguous working memory (an address space), while in fact it may be physically fragmented and may even overflow on to disk storage. Systems that use this technique make programming of large applications easier and use real physical memory (e.g. RAM) more efficiently than those without virtual memory.
http://en.wikipedia.org/wiki/Virtual_memory

It might also be helpful to read about PAE:
http://en.wikipedia.org/wiki/Physical_Address_Extension

Quote:
In computing, Physical Address Extension (PAE) is a feature of x86 and x86-64 processors that enable the use of more than 4 gigabytes[1] of physical memory to be used in 32-bit systems, given appropriate operating system support. PAE is provided by Intel Pentium Pro and above CPUs (including all later Pentium-series processors except the 400 MHz bus versions of the Pentium M), as well as by some compatible processors such as the Athlon and later models from AMD.

The x86 processor hardware is augmented with additional address lines used to select the additional memory, so physical address size is increased from 32 bits to 36 bits. This increases maximum physical memory size from 4 GB to 64 GB. The 32-bit size of the virtual address is not changed, so regular application software continues to use instructions with 32-bit addresses and (in a flat memory model) is limited to 4 gigabytes of virtual address space. The operating system uses page tables to map this 4 GB address space into the 64 GB of RAM, and the map is usually different for each process. In this way, the extra memory is useful even though no single regular application can access it all simultaneously.
I looked this stuff up some time ago before I switched to 64-bit, just so I knew a bit about what was going on. I know only what's in the wiki, ask johnsfine for more, he's the expert on these topics.
 
Old 04-24-2009, 01:02 PM   #11
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
When we talk about the size (32 or 64) of an architecture, we are talking just about the storage required for a virtual address. Years ago, many other things (bus widths, register widths, etc.) might have been meant. But those are so varied within x86-64 and other modern architectures to be hopeless for comparison. So that number has come to mean just the number of bits needed for a virtual address.

But just because 64 bits are needed doesn't mean 64 bits are used. The x86-64 architecture only uses 48 bits of virtual address.

Just because the architecture uses 48 bits, doesn't mean the OS uses 48 bits. If I understand correctly, 64bit Windows uses fewer bits. The 44 mentioned earlier in this thread sounds right.

The number of physical address bits in an architecture is independent of the number of virtual address bits. If I remember correctly, 32bit x86 with PAE has 36 physical address bits. Then the number of physical address bits supported by a particular CPU chip may be less than the number in the architecture. In Intel x86-64 I think the number of physical address bits supported by the motherboard may be less than the number supported by the CPU chip. (I don't think that is possible with AMD designs).

It is also possible for the OS to limit the number of physical address bits below the hardware limit.
 
Old 04-24-2009, 01:36 PM   #12
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by johnsfine View Post
In Intel x86-64 I think the number of physical address bits supported by the motherboard may be less than the number supported by the CPU chip. (I don't think that is possible with AMD designs).
I think that all is needed is for the hardware to feed the CPU what it wants to see. So, given that, the AMD CPUs should work fine with any number of bits in hardware. Or are you speaking of AMD chipsets instead of CPUs?

As far as PAE is concerned, I believe they implemented that with the "segment register" concept that we saw in 16-bit Windows, didn't they?
 
Old 04-24-2009, 02:01 PM   #13
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by Quakeboy02 View Post
I think that all is needed is for the hardware to feed the CPU what it wants to see. So, given that, the AMD CPUs should work fine with any number of bits in hardware. Or are you speaking of AMD chipsets instead of CPUs?
Actually I was referring to the fact that the memory controller is part of the CPU chip in AMD systems, but is a separate component on the motherboard in Intel designs.

The "physical address" is primarily something communicated from the cpu to the memory controller, so it is possible to use an Intel CPU in a motherboard whose memory controller supports fewer physical address bits than the CPU. But it seems to be a meaningless concept to say an AMD memory controller supports a different number of physical address bits than the CPU.

Quote:
As far as PAE is concerned, I believe they implemented that with the "segment register" concept that we saw in 16-bit Windows, didn't they?
Sorry, that is nonsense.

Allowing more than 32 bits in a physical address (as is done in both PAE and 64-bit mode) required doubling the size of a page table entry compared to the original 32bit architecture (as is done in both PAE and 64-bit mode). In some old designs, Intel did that by doubling the size of a page table block. But in both PAE and 64-bit mode they do it by halving the number of entries in a page table block, which reduces the number of virtual address bits supported by a two level page structure from 32 to 30.

Then to increase the number of virtual bits (back to 32 for PAE and up to 48 for 64-bit mode) they add layers to the page structure (gaining 9 bits virtual per layer). PAE adds one mini layer to gain 2 bits from 30 back up to 32. 64-bit mode adds two full layers to get from 30 up to 48.

The page table entries supported by 32-bit mode without PAE support virtual addresses of 12 bits plus 10 bits per layer (ultimately limited to 32 bits, so only two layers can be useful).

The page table entries supported by 32-bit mode with PAE and by 64-bit mode support virtual addresses of 12 bits plus 9 bits per layer. 32-bit with PAE is still fundamentally limited to 32 bits virtual so only two and a fraction layers are possible. 64-bit mode would be fundamentally limited to 64 bits virtual, but it is limited first by the fact that the architecture only supports four layers of page table.

The whole paging structure is inside the OS kernel and doesn't concern the application code. The exact same application code can run (no recompile) with or without PAE and even in 32 bit mode under a 64 bit kernel.

Segment registers require complex support at compile time for the application. PAE is much much cleaner than that.
 
Old 04-24-2009, 02:26 PM   #14
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
John,

I guess I misread the following from wiki, then. I didn't mean to imply that application programs used the segment register, though - just the kernel. On rereading it, I see that it's not the segment register, but something else.

Quote:
Physical Address Extension (PAE)
Main article: Physical Address Extension

By default, physical addresses are 32-bit, however, there exists a page extension mode called Physical Address Extension or PAE, first added in the Intel Pentium Pro, which allows an additional 4 bits of physical addressing. The size of memory in Protected mode is usually limited to 4 GB. Through tricks in the processor's page and segment memory management systems, x86 operating systems may be able to access more than 32-bits of address space, even without the switchover to the 64-bit paradigm. This mode does not change the length of segment offsets or linear addresses; those are still only 32 bits.
 
Old 04-24-2009, 02:50 PM   #15
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
In a segmented addressing system you have translations from
A) Segmented to Linear
B) Linear to Physical
C) Physical to (column, row, channel, bank, etc.) in the memory controller.

In a non segmented addressing system, the Segmented to Linear step is eliminated or made one_to_one, and the Linear to Physical translation is renamed "Virtual to Physical".

The x86 CPUs in (kernel) 32 bit mode support both segmented and non segmented operation. But 32 bit Windows and Linux only supported non segmented.

The 16 bit modes were segmented and 16 bit Windows used segmented addressing.

IIUC, when the kernel is in 64 bit mode, even 32 bit application modes do not support the translation layer from Segmented to Linear. I think the kernel needs to be in 32 bit mode (and running some weird OS) for the application to use 32 bit mode Segmented addressing.

When the kernel is in 64bit mode and the application is in 32bit mode, the full 64bit four level paging system is used, including support for physical addresses of 40 bits or more (depending on which CPU chip you have).

BTW, the word "tricks" in the thing you quoted is biased and misleading. Because of the multi layer translation system, there was never a fundamental connection between the number virtual address bits and the number of physical address bits. Changing the number of physical address bits from 32 to 36 was a clean and isolated change and doesn't deserve the word "tricks".
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Max memory for Slackware captain chaos Slackware 6 11-16-2006 09:36 PM
What is the max memory a process can use? shelby Linux - Hardware 1 04-27-2004 12:05 PM
What's the Max XP memory ( 4GB ? ) deft General 3 01-20-2004 11:16 PM
Does anyone know the max memory a process can use? A_quest_guy Linux - General 7 07-18-2002 06:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration