r/computerscience • • 25d ago

Discussion Why Don't We Have 64-Bit Physical Addressing?

Since x86_64 (ig aarch64 and riscv64 too) architectures use 64-bit general-purpose registers, but current implementations limit physical and virtual addressing (e.g., to 48 or 57 bits), what engineering or physics or economics problem prevent us from building a CPU with a full 64-bit physical address space (supporting 16 EiB of RAM)?

I don't know anything about how CPUs really work so mind my stupid question.

304 Upvotes

134 comments sorted by

65

u/Broad-Promise6954 25d ago edited 25d ago

There's nothing in electronics or physics to limit this, but there's plenty in economics, as there are always tradeoffs to make (some of which are electronics / physics based so you can stretch this around however you prefer).

The TL;DR variant is that it costs more to use more bits so they originally went to 48 bits as a convenient compromise. That put them in a bit of a box when the compromise turned sour, so they added an enable (LA57 in this case) for the next compromise they picked. If and when this one gets old and moldy they'll add another enable flag, etc.

(I'm on phone, can expand on the compromise thing when I'm back on a real keyboard)

17

u/Matheweh 25d ago

So it's basically just because no one needs that much memory then? If one wanted they could easily make a 64-bit address? Like it won't be too power hungry or anything like that?

16

u/Broad-Promise6954 25d ago • Thanks

OK, here's where it gets complicated...

First, we've chosen to use "virtual memory" on these systems, where some program's "address 0x00123458" isn't actually physical address 0x00123458. The translation from virtual address to physical goes through (on x86 anyway) a multi-level "page table" system: some bits near the top of the usable virtual address select 1 of N page-table-pages, which contain bits saying which addresses are to be called accessible and which aren't, and for those that are, where to find the next level of page table pages, and so on. For LA57 mode this goes up to 5 levels deep, for 48 bit mode it tops out at 4 levels, and to add more virtual address bits we'll need to go to 6 levels and/or do something else different.

The current x86-64 limit is actually larger than 48 bits. Here is a stackoverflow Q&A about Linux's 48 bit limit. The 52 bit limit in the chip is based on how they divided up the transistor budgets for things like the TLB. There are also "pin budgets" on the ball grid arrays coming out of the CPU. There are ways to work around pin budgets (using two phases of addressing for instance, a la row-and-column addressing on physical DRAM) but you spend time doing that.

There's also power budgets on real physical boards, as you've noted. We tend to work around those by lowering the voltage thresholds: really old DRAM used 5 volts, then they went to 3.3V, and now it's all nominal 1.1V. Going lower than this gets tricky. We can always add more power rails and capacitors for short term energy storage, but then we get into heat and cooling budgets (which are already a huge problem for the fancy GPUs in AI systems, and even for home gaming systems).

And, of course, there are dollar budgets: current prices seem to be around US$500 for 32 GB, so 4 petabytes of DRAM would be roughly $60 million. (I blame Sam Altman šŸ˜€)

We use physical addressing for PCI hardware peripherals, and the software people like to use some high bit(s) for this, so we'd want a limit of 51 bits of actual DRAM, or 2 PB, which cuts that cost to a mere $30M.

These aren't in any particular order, but I'll add one more constraint, namely physical space (note that this one interacts with the power and cooling budgets). We like our wires to be really short, both for speed -- it takes light a nanosecond to go a short distance and the electric energy wave propagates at less than light speed -- and for limiting losses. Packaging enough DRAM to fill a petabyte or two requires a lot of physical space. We can make the trade-off of using slower access to get to it, similar to the trade-off of multiplexing the physical address over fewer BGA pins or wires, but nobody wants to pay that price right now.

0

u/Matheweh 25d ago

Thank you for explaining in such detail.

26

u/Silly_Guidance_8871 25d ago

240 bytes of RAM is 1TB, which is in the arena of what most really high-end servers support — 40-42 bits of RAM per CPU. Once you add in swap (if you're doing that), 48 bits starts to look awfully close. By contrast, 257 bytes of RAM is 128PB — a 512-fold increase over the prior 48-bit limit. Going the rest of the way to 64 bits is another 128-fold increase over 57 bits, and you're now at 16EB of addressable space, which is, mind you, ~24 bits more than a typical high-end (a 16,777,216-fold increase)... any way you slice it, that's a lot more RAM for a single CPU, in a single server.

At present, a 1TB DDR5 (8x128GB) kit starts at $35,000 — and you'll need 224 kits (~16 million kits, or ~128 million sticks). So, a paltry $36.7 billion to max out the 64-bit address bus on a single cpu, in a single server. I do not envy the poor bastard that has to run the traces for those 128 million sticks. Each requires its own ~120 traces, so we're now talking ~15 billion unique wires on the motherboard just for RAM for that one cpu. At present, and probably for the next decade (since memory capacity growth is slowing), 57 bits will be out of reach for a single cpu (which is itself a single point of failure).

It's just going to be far cheaper to have multiple servers, each with a reasonable amount of RAM (which will vary by the memory generation), and dividing up the tasks across the servers. Which, to be fair, has always been the case for "really large" tasks.

7

u/KittensInc 24d ago

Swap is irrelevant here, as swapped memory is pages which do have a logical address but do not have a physical address backing it up. In other words: they take up zero physical address space.

On top of that, virtually all servers have swap disabled. Unlike, say, a memory-constrained desktop there are no applications sitting in the background which rarely wake up but still need to keep a decent bunch of memory around. If a server has to swap, its performance will degrade to the point that it may as well be offline completely - you never want to end up in that scenario.

3

u/Interesting_Debate57 24d ago edited 24d ago

One irrelevant side note: you should never disable swap on a server.

Going into swap means that you have a massive process or network or disk thing that's been happening for awhile, and if you monitor the physical devices, you'll get pinged on this and now you'll be able to find the much larger problem that plagues however many rack mounted boxes you have. Needing to update the configs on one box in active distress and then 99 boxes that haven't hit the limit yet is a real use case. Generally you'd rather do the latter first.

It's called "canary in a coalmine".

1

u/dr3aminc0de 23d ago

This feels like the opposite of canary in the coal mine to be honest. If you disable swap your application crashes loudly and you get alerts/pages. If you enable it that increases the time to getting paged because the server goes to swap instead of crashing.

Am I misunderstanding?

2

u/Interesting_Debate57 23d ago

Swap gives you anywhere from a minute to a few days to figure out what's spiking while continuing to service requests. Some operating systems (sun OS was one) recover very gracefully as the load goes down, but you'll notice that it got slow in your response-time graphs and can go figure out why by looking at the logs.

1

u/Silly_Guidance_8871 23d ago

For a testing server, crashes are generally preferable to slow-downs; for a production server, it's generally the opposite.

1

u/mimi_vx 23d ago

That depends largely on what you run and what you expect. Some workloads truly avoid swap under any circumstances. Ā 

For instance, workloads with hard real-time demands and precise maximum latency fall into this category. Ā 

Yet in most situations, swap is desirable and generally recommended.

1

u/bmayer0122 23d ago

I know just enough about this to get in trouble, but to be able to fit all of that in physical reality it is going to be big.Ā 

Are you going to have low enough latency from the controller to the RAM module?Ā 

Gemini did the math for me:Ā  To pack 16 million RAM modules around a single CPU, you would need a circuit board covering roughly 17,000 square meters (4.2 acres). Assuming a perfectly circular board to minimize trace lengths, the longest distance from the CPU in the center to the outermost memory module would be 73.7 meters (242 feet).

1

u/flatfinger 23d ago

Even from a physical standpoint, I could see advantages to having multi-core designs use upper address bits to direct which kinds of caching should be applied to regions of storage that may or may not be shareable with different cores in different ways. I doubt that there would often be much need to use all 64 bits, but I can certainly imagine some usefulness to having a variety of memory areas that would be populated by various amounts of RAM that could for some areas be quite large. For example, each core might have a non-shareable region of storage whose address is not used for any purpose by any other core, ensuring that if code accidentally tried to use a pointer to that storage on a core that couldn't support it, the attempt would trap rather than accessing storage that core was used for something else.

0

u/saf_e 24d ago

For one server definitely,Ā  but not clusters/numa. Where 57bit extension make sense.

2

u/KittensInc 24d ago

Clusters aren't going to share a physical address space, though. They could maaaaybe share a logical address space, but even that is unlikely: it would technically be possible, but in practice I doubt the added hassle is worth it.

1

u/saf_e 24d ago

Ok, for cluster it depends on cluster architecture. But numa has shared physical address space.Ā 

1

u/sixtyhurtz 24d ago

Sure, but the most number of sockets on an amd64 board is 8. That would mean 32TB per socket. Even if you divided it further in 32 NUMA nodes, that's 8TB per NUMA node.

If AMD or Intel had a customer who wanted more than that for a specific HPC application, they could do it. The architecture supports it. However, the fact they have never done it suggests the demand simply isn't there.

1

u/Silly_Guidance_8871 24d ago

Or the greatness of the cost exceeds the desire to pay, even at that bleeding edge

1

u/Silly_Guidance_8871 24d ago

Even then, I'm not aware of too many servers than can make it past a single-digit of TB per box -- the number of sticks (and thus, the number of traces) gets unwieldy.

1

u/bmayer0122 23d ago edited 23d ago

Does anyone do NUMA hardware anymore?Ā 

The last I was aware of are machines like the some of the SGI machines and the Unisys ES7000.

Everything went to distributed shards. There was an amazing paper by Google that I can't find at the moment but just about all of their search papers are an example of this, Spark/Hadoop, MPI if you are doing scientific computing.

2

u/Broad-Promise6954 23d ago

Oh yes, both Intel and AMD have all kinds of NUMA topologies on their bigger server setups. In general you get the best performance by configuring each chip or even chiplet with more-direct access to whatever is physically closest. Linux and the various BSDs all have NUMA-aware allocators.

This doesn't affect the number of physical address bits as the PCI interconnects will still reach across as needed. The details vary a lot between the Zen (AMD) and Intel architectures, but the topology encoding in the BIOS is the same on both.

1

u/bmayer0122 23d ago

What is the largest socket count this go up to practically or theoretically?

Oh! This tickled something in the back of my brain from 10 or 15 years ago. There were a set of AMD processors (Threadripper?) that had a special section / module that would allow you to scale to two processors, and then if you bought the next level up you could go to four or eight processors? I'm failing to recall the name of that technology.

2

u/Broad-Promise6954 23d ago

I've only seen two-socket boards but I haven't looked hard. A quick search suggests 2 max today. I have a vague impression that EPYC's design parameters allow 4 but this would need a different socket (sp5 is limited to 2 and sp6 to 1 according to Wikipedia).

1

u/bmayer0122 23d ago

Hypertransport was the technology that allowed for up to eight-way systems.Ā 

They are now using something called Infinity fabric which only supports two socket.

The rationale is we have so many cores in a single socket that you just don't need the high multi-socket count.

5

u/Liam_Mercier 25d ago

I think in theory you would slow the CPU down slightly because of how many bytes are required to represent instructions accessing 64 bit addresses versus 48 bit addresses, but that could be wrong.

7

u/godofpumpkins 25d ago

Most sub-8 byte quantities are represented as 8 bytes because the uniformity is faster to deal with in practice. You can go around precisely bit-packing your stuff into one byte but unless you ask it to explicitly, your compiler will not pack the data in any more tightly than a 32 or 64-bit boundary

1

u/Liam_Mercier 24d ago

I see, so if we want to use a 48 bit address we probably are still using an 8 byte register to store the value, so the actual instruction size to get the 48 bit address into a register is going to be the same as one for a 64 bit address because they both load 8 bytes?

2

u/godofpumpkins 24d ago

Yeah. And it’s more annoying at boundaries, so imagine you did ask your compiler to pack the structs. If you want to read a misaligned 64-bit value, say one starting at byte 1 and ending at 9. It’ll likely read 16 bytes of memory to pull out 8.

1

u/sdlab 24d ago

CPU is limited by architecture to address a limited amount of RAM, like... 128 GB for a consumer CPU, on a server CPU it is different amount.

-1

u/Environmental-Ear391 24d ago

Using "Virtual Addressing" the Memory Address is 64bits in registers...

However despite this thr bus has a limitation of how many bits in the signalling with 48bits immediately usable.

The 48bits of address on the hardware bus is not a fixed limiter as using an external MMU you can exceed 64bits or beyond that...

It is entirely dependent on connectivity....

and for PCI Express every CPU read/write is using a serial link so it is more a question of how many bits at each end actually are needed, not the full address width.

224

u/fixminer 25d ago

Because that amount of RAM doesn't exist. Why would we include useless pins, traces, etc.?

130

u/caboosetp 25d ago

For context, 248 givesĀ  256 TB of ram.Ā 

94

u/backfire10z Software Engineer 25d ago

Pffft, I’ve downloaded more RAM than that in a week.

66

u/Wet_Side_Down 25d ago

Don’t say that too loud or Altman will come sneaking around

24

u/backfire10z Software Engineer 25d ago

Hold on, someone’s at the door

6

u/Dr_Dressing Computer Scientist 24d ago

Hello, it's Altman. I hear you might need some Downloading Ram Insurance?

9

u/CongasAndBrooms 25d ago

Yeah, well I've got special software that DOUBLES my memory!

11

u/AdreKiseque 25d ago

Ok but what if we had 65536 times more though

3

u/TantKollo 24d ago

Nah -1 all the way man

3

u/telionn 24d ago

But you don't want to run too close to that limit, or else heap fragmentation becomes a concern again.

3

u/Randommaggy 24d ago

The current max you can buy if you had the cash is 32TB though that's split across 8 CPU sockets.

1

u/rumblemcskurmish 24d ago

Damn, I have 257TB installed so that's why my BIOS shows 1TB missing . . . .

1

u/armahillo 18d ago

ok but at what cost

1

u/caboosetp 18d ago

There are already computer systems with more ram than that. You can search to find out roughly what they cost.Ā 

The performance cost is extra paging though.Ā 

0

u/SilverAwoo 24d ago

That’s almost enough RAM for 3 whole Chrome tabs!

16

u/mckenzie_keith 24d ago

The address bus lines will be added when the RAM becomes available. Believe it or not, all these companies talk to each other and share their product roadmaps, etc.

3

u/glassmanjones 22d ago

And pricing!

-2

u/granadesnhorseshoes 24d ago

I imagine someone said almost the exact same thing about 32bit cpus and 4GB of ram back in the 90s.

To be fair to you though, it's several orders of magnitude bigger jump from current tech to 16 exabytes than it was from 32 megabytes to 4 gigabytes.

8

u/KittensInc 24d ago

Yeah, but the 32-to-64 transition was a logical one: the reason it was a huge pain is because all the software had to change. Transitioning to a wider physical address is completely transparent. Nothing needs to be changed except the CPU itself and some tiny backwards-compatible OS-level updates.

The current physical address limits are only a problem if you want to stick more than 2^48 bytes of memory in a current CPU. Which is impossible, because DDR5 modules of the required size do not and almost certainly will never exist.
The worst you can do right now is probably a dual-socket SP5 motherboard, which means 2x12 channels, and at 2 DIMMs per channel that's 48 slots of DDR5 - which would each need to be 5864 GB large. The largest prototype modules at the moment seem to be 256 GB, so there's still space for a 20-fold increase.

And mind you, that 20-fold increase would need to be in the current generation for it to become a problem. An upgrade to a future DDR6 (which would make quite a bit of sense, simply to not be bottlenecked by the bandwidth) would mean newer CPUs, which would mean a trivial upgrade to, say, 56-bit physical addressing.

17

u/commit_bat 24d ago

It would have been useless to include more lines for RAM than you can put in the computer back then too.

9

u/rini17 24d ago

You want a 486 with terabyte of RAM? What for?

7

u/dauntlesspotato 24d ago

I have a lot of chrome tabs...

-1

u/ConsciousBath5203 24d ago

I have my reasons. Though, with my current implementations of deriving from the ai memory space, I can probably do significantly more with a 32bit address space than most people can with the 64

1

u/OddStuffHappensTwice 22d ago

I bet you're not as superior as you seem to think you are.

1

u/ConsciousBath5203 21d ago

I bet odd stuff happens more than twice

3

u/CowBoyDanIndie 24d ago

The 386 was a 32 bit cpu and it came out in 1981. Most of the 32 bit cpus in the 90s were not actually limited to 4GB of address space for the machine. Starting with the Pentium Pro, they all had PAE, they had a 36 bit address bus, 32 bit remained the address space within a process. So a pentium pro which was released in 1995 could physically address 64 gb, but each process running could only address 4 gb. Note that the address space is more important when dealing with virtual memory than physical memory. Virtual memory allows a process to ask for a very large continuous address space even when the physical memory is completely fragmented.

3

u/DragonFireCK 24d ago

We had 32-bit processor with 36-bit physical addressing. We hade 32-bit computers with 24-bit physical addressing. I think those are the most extreme for the 32-bit generations, at least with any meaningful adoption. These limit how much memory the OS can see, and thus how much can meaningfully be in the computer.

A lot of 32-bit software (effectively) used 31-bit virtual addressing. This is why a lot of 32-bit programs were limited to 2GiB of memory. Much of this was due to a historical fact that the top bit was used for OS bookkeeping. These limits matter for any single process.

Interestingly, a lot of 16 bit computers used 32 bit addressing via segments. That is where the term ā€œlong pointerā€ comes from that is still used in the Windows SDK, as well as the ā€œsegment registerā€ still in x64 CPUs. In those days, you could have either a 16 bit (short) or 32 bit (long) pointer, even with the CPU being only 16 bit.

1

u/TheThiefMaster 24d ago

Though x86's segments weren't spaced every 64 kiB - they overlapped so much that there was one every 16 bytes! The total address space was only 20 bits, despite the 32 bit long pointers

1

u/cybekRT 24d ago

But even with 32bit CPUs, we had CPUs with smaller physical address space. It's much easier to add physical lanes to the CPU when architecture already supports it. It's up to hardware and firmware to just report this as available space, it doesn't change software. It's not the same as moving from 16bit pointers to 32bit.

1

u/DragonFireCK 24d ago

We had 32-bit processor with 36-bit physical addressing. We hade 32-bit computers with 24-bit physical addressing. I think those are the most extreme for the 32-bit generations, at least with any meaningful adoption. These limit how much memory the OS can see, and thus how much can meaningfully be in the computer.

A lot of 32-bit software (effectively) used 31-bit virtual addressing. This is why a lot of 32-bit programs were limited to 2GiB of memory. Much of this was due to a historical fact that the top bit was used for OS bookkeeping. These limits matter for any single process.

Interestingly, a lot of 16 bit computers used 32 bit addressing via segments. That is where the term ā€œlong pointerā€ comes from that is still used in the Windows SDK, as well as the ā€œsegment registerā€ still in x64 CPUs. In those days, you could have either a 16 bit (short) or 32 bit (long) pointer, even with the CPU being only 16 bit.

1

u/cybekRT 24d ago

The "32bit" long-pointer was actually a 20bit pointer. The segment address was shifted by 4 bits to left and then added to base pointer.

1

u/BatchModeBob 24d ago

Borland Turbo C large memory model: MK_FP (a, b). That was my life for so many years.

1

u/WoodyTheWorker 24d ago

void __huge*

1

u/EpochVanquisher 24d ago

Some of the 32-bit CPUs in the 1990s had 24-bit addresses. The 386SX is probably the most popular one.

1

u/StuckInTheUpsideDown 24d ago

We don't design today's CPU architectures around the memory requirements 30 years from now.

0

u/Antagonin 24d ago

We now known, it's getting much harder to shrink memory cells.

17

u/zeekar 25d ago

because you don't have that much RAM. Nothing does. We're getting to the point where big cloud machines have more RAM than 48 bits can address, so they have more address lines, but no machine has sixteen ebibytes of RAM. Every one of those address lines is a pin on the CPU package that can't be used for anything else... why waste it?

3

u/Cold-Jackfruit1076 24d ago edited 24d ago

The simple answer, without getting bogged down in too much technical jargon: there's simply no reason to do it. There isn't a single computer anywhere in the world that uses anywhere near 16 EiB of RAM1, and no foreseeable use case for that much memory.

The technological outlay is enormous. Every address bit needs a wire from the CPU to the RAM; to address 16 EiB (264264 bytes), you'd need billions of unique wires (something in the range of 15 billion for a single motherboard).

Not to mention that the memory bandwidth and access time of that much RAM would be unworkable; you simply can't move data fast enough to make the CPU wait for it on any practical timeframe. It would take ~270 years to simply scan the entire 64-bit address space.

The other consideration is heat: that much RAM would generate 402 megawatts -- enough to power 400,000 homes -- and if the cooling failed for even a moment, the entire thing would fry in a few seconds.

1Ā The largest single-socket server configurations currently available are typically maxed out around 4–8 TB to 32 TB, and even Livermore's exascale supercomputer El Capitan only uses 5 petabytes, distributed across thousands of processors.

1

u/DonutConfident7734 23d ago

but memory is addressed by columns and rows, to reduce number of wires. The address is split to get the column and row.

1

u/BrazilianAnimal 21d ago

One part of the problem is that there is a mapping from virtual addresses to physical memory that is implemented in hardware, and for virtualization that is multi-level. More bits would make it more complex.

6

u/endstop 24d ago

With modern Intel or AMD CPUs you're all set to 128 PiB.

https://en.wikipedia.org/wiki/Intel_5-level_paging

Let us know if you've got a system that can even approach physically accommodating that and around a billion USD to buy the RAM.

Memory training at boot would likely take 1500 years. Make sure to get the CTO absolutely wasted before pitching the project.

2

u/roankr 24d ago

How did you come to the 1500 year number? What's the calculations for that?

0

u/Pewdiepiewillwin 24d ago

I think op is referring to physical not virtual memory. L5 increases the virtual address space, you are still limited to 52 bit physical addresses.

2

u/Emu1981 21d ago

Why Don't We Have 64-Bit Physical Addressing?

We don't have 64-bit physical addressing because the cons far outweighs any sort of potential benefit that you get from being able to address 16 exabytes of RAM. 64 bit physical addressing would require extra circuitry (and power draw) inside the CPU and memory controller to be able to handle the extra 20-26 bits of addressing that isn't needed with 48-52 bit physical addressing like we have today. There is no benefit either because 48 bit addressing can handle 256TB of physical address space which is significantly more than most computer users will ever need and for those who 256TB of addressability is not enough there are CPUs that support 52 bit addressing which can handle up to 4PB of physical address space.

Compare that to the fact that 512GB DDR5 DIMMs are only in platform validation at the moment, where even having 32 DIMM slots will only get you up to 16TB of RAM which is far lower than the 256TB limit of 48 bit addressing.

You may read this and wonder why 52 bit addressing even exists but that brings up the fact that stuff other than RAM in the system can be mapped into the physical address space like GPU VRAM, and new storage technologies like NVDIMMs and CXL which can push the addressability requirements far past 256TB.

1

u/sceadwian 20d ago

Sam Altman called.

He said shut up and give him more bits. ExiB's of memory? <swoon>

4

u/rupertavery64 24d ago

Using google back-of-the-napkin AI calculations, 16 Exabytes of RAM weighs approximately 1,678 metric tonnes if you use the dense memory standards available today, assuming 256 GB RAM sticks that weigh 25 grams each.

That is roughly the weight of 3.5 fully loaded Boeing 747 airplanes

16 Exabytes = 17,179,869,184 GB

at 256 GB / stick = 67,108,864 sticks

67,108,864 * 25g = 1,677,721,600g or 1,677,721kg

3

u/MMcKevitt 24d ago

Hadn’t even considered the weight, nice call out

2

u/MagicWolfEye 25d ago

Do you really need to be able to address 16 exabyte

2

u/granadesnhorseshoes 24d ago edited 24d ago

Every additional bit you add doubles the available address space. 16 bits caps out at 64KB, 32bit caps out at 4GB. so the jump was from 64KB to 4096MB

64bit caps out at 16EB. So that jump from 32 to 64 was from 4GB to 17.1 billion GB.

Needless to say, they save on cost and effort by not bothering to physically implement the circuitry for ALL 64 bits.

Edit: KB for the 16-bit cap, not MB.

2

u/degaart 24d ago

16 bits caps out at 64Kb. Not 64Mb.

1

u/granadesnhorseshoes 24d ago

You are correct, Wasn't thinking about it that much on the lower end and mislabeled it.

1

u/Eggy002 24d ago

why would we even need that much ram when were still not using all the 512 tb some systems offer now

1

u/fcddev 24d ago

Several reasons:

  • that amount of RAM doesn’t exist
  • adding addressable bits increases the depth of page tables, which slows down accesses not cached in TLBs. An uncached access slows down from 5 fetches to 6 fetches with 5-level pages, which you may need to pay even if your system doesn’t need more than a 48-bit address space Ā * (there is also a memory cost to supporting more page table levels, which again you may need to pay even if you don’t have enough RAM to benefit from it)
  • on ARM especially, non-address bits in pointers are used for other purposes (top byte ignore, MTE, PAC)

1

u/FedUp233 24d ago

One thing I don’t think I saw mentioned is what problem are you going to solve that needs that much memory all addressed by a single cpu? To effectively use that much memory you’d probably need to add many more cpu cores. And that’s a diminishing return problem since the more cores, the less memory bandwidth each core gets.

Plus, the deeper the page tables get they also tend to get slower. I think the cpus have kind of reached the li it where deeper page tables would also start to be counterproductive. So the other option is to increase the page size. 7 more address bits would be pages 128 times the current 4k size which is probably ridiculous so maybe a compromise of 64k or 128k pages plus a bit wider page table. Of course, do you want to use the same cpu with less memory? Having multiple page sizes would mean a lot of logic in the memory address logic and again slow it down. Or do ypu build a complete separate IC just for the big memory systems - with really, really low production numbers and or a flexible one with lower performance and higher cost for the vast majority of users who don’t need anywhere that much memory.

And of course if you have lots more cpu cores, you need more cache memory for each of them, plus to get similar cache hit frequency you need much bigger L2 and L3 caches as well.

So in the end you are probably better off with machines with less memory for all the foreseeable problems. And for solving multiple problems better off with several smaller machines or a cluster of smaller machines.

Basically, there just is no market for single machines with memory of those sizes.

1

u/SapphireLabs_Yuki 24d ago

We do. The upper 14-17 or so are reserved for other purposes. No point in addressing the entire 64 bit space if it can't be used to begin with, and it would add an extreme amount of circuitry that would literally never get used.

1

u/RobertTheTraveler 24d ago

Afaik DEC Alpha was fully 64 bit.

1

u/KingOfZero 23d ago

Not physical address lines. And none of the chips even supported a full 64-bit virtual address. The first Alpha only implemented 43-bit VA and 34-bit PA lines. I'd have to go check for later Alpha chips, but certainly none of them had a 64-bit PA

1

u/mastercoder123 23d ago

Ibm mainframes are probably the only thing that supports 64 bit physical addressing yet its not used as its useless

1

u/Hattix 19d ago

20164 used 43 bit virtual addresses and 34 bit physical addresses. For the day, that was excessive. 21164 upper that to 40 bit physical addressing, but retained a 43 bit virtual address space.

Alpha 21264 retained the same addressing layout as the 21164 for compatibility reasons, but also had a 48 bit virtual addressing mode, in this 44 bit physical addressing was possible. Since virtual address space changed, this required changes in the OS, hence why DEC kept the 43 bit virtual mode.

1

u/bigvalen 24d ago

It's about $9 billion to buy the 256TB you would need to max out the memory of a single Xeon CPU. We should be good for a while.

Our machines with 3TB take about 8 mins to test & init ram on boot. I can't imagine the time on 256TB machines :-)

1

u/Maleficent_Cycle561 24d ago

All the answers are great. As a tldr analogy, the best tool for a job is the right tool not the most powerful or biggest tool or most expensive one. My car doesn't need and doesn't do the job I need with a jet engine, it can't functionally be used. The gearing ratio in my drivetrain isn't the power powerful, but it is well suited to the powerplant(engine) which is well suited to the fuel system, which is well fitted to the constraints of the usecase. Just as my car can't meet the use case where a jet engine is useful/necessary nor massive gear ratio drivetrain (tractors etc).

Obviously those analogies are technologies that have use cases. So back to the mathematical answers, there's no current practical use case. However there is a usecase for unbounded growth, which that headroom supports. We're also bounded by power of 2 steps, so it needed to be 64bit.

1

u/Camofelix 24d ago

it's not useful, costs verification time, area, and power. silicon is mostly a zero sum game. we don't support anything we don't need.

and the things we barely need, we barely support (see the 8087)

1

u/throwaroo202020 24d ago

Each one of those bits needs to be a physical wire between the cpu and ram. The more wire, the more complex and expensive cpus and motherboards become.

1

u/Other-Biscotti6871 23d ago

Mostly because that's too much stuff to pack in one machine; when you work across machines you move into the 128-bit space of IPv6 Internet.

There's an argument that the progression should have been 24/48/96 rather than 32/64/128 from what the physics does, but the 32-bit stuff appeals to the software engineers over 24-bit, because it's a straight doubling (8/16/32).

Physically, a RISC processor can efficiently address about 2MB of RAM directly, to do more than that the 2MB becomes the L2 cache, and data in the larger space is swapped in and out of it. Doing address calculations for a space bigger than you need costs in time and energy, Intel crushed Sun because Sun moved to 64-bit, and that made their processors slower, Intel stuck with 32-bit which was good enough for webservers and 80's PCs.

1

u/xzgyo 23d ago

ęÆ”å°”ē›–čŒØčÆ“640kbå†…å­˜å¤Ÿē”Øäŗ†

1

u/david-1-1 23d ago

I understood the move from 16 to 32 bits, but not to 64 bits. In instruction space, 32 bits is complex enough for register and memory references, and opcodes. But even if true 64 bit addressing were easy to do, you'd have to pack multiple instructions into such long words! It doesn't make sense.

1

u/InternalImpact2 23d ago

Too much wires

1

u/naemorhaedus 21d ago

because it isn't necessary. Why waste resources?

1

u/This_Maintenance_834 25d ago

if someone has all the money in the world, then he can only build two computers with a full 64-bit memory populated. no one else will get any memory in the world.

Altman will be pissed.

2

u/Total-Box-5169 24d ago

And it would consume half a billion dollars in electricity per year only to power that RAM.

1

u/Empty-Insurance5290 24d ago

I think Altman would make that machineĀ 

0

u/Apart_Ebb_9867 24d ago

Altman will be pissed.

actually Altman would be delighted if those two computers were his bitches…

0

u/This_Maintenance_834 24d ago

too bad, that is DDR, not HBM. Altman will need 6 years to get one 64-bit HBM populated computer.

1

u/sp4zi 22d ago

I don't think Altman knows the difference.

1

u/tropix126 24d ago edited 24d ago

For virtual addresses on x86-64, you can get up to 57 bits if the CPU does 5-level paging. The architectural reason for why it doesn't take up all 64 bits is because A) it's unnecessary for current hardware, and B) x86-64's pagetable entries are 64-bits wide and need to store some metadata for each entry, meaning the address bits can't take up the whole entry because they need room for that metadata.

On AArch64, the reason is slightly different. Depending on the processor features, the architecture actually uses those bits for security extensions like pointer authentication (PAC) and memory tagging (MTE). The exact number of bits reserved for virtual addresses is reported by the ID_AA64MMFR2_EL1 sysreg and is processor-dependent ranging from 48-56 bits.

1

u/WittyStick 24d ago edited 24d ago

meaning the address bits can't take up the whole entry because they need room for that metadata.

The metadata is part of the address - it's just broken into a 12-bit page index and multiple 9-bit table entries. The upper 7 or 16-bits of the 64-bit word are all required to match the most significant bit of the pointer - a so called "canonical" address. There's an extension called LAM/UAI which relaxes this, where only the 63rd bit is required to match the most significant bit of the pointer, and the other 6 or 15 bits can be anything and are ignored when dereferencing the pointer - but LAM is rarely used. It needs enabling at the Kernel level to be used in userspace, and it's full of problems - two pointers which refer to the same virtual address may not compare equal - and there have been Spectre-like vulnerabilities.


5-level paging itself is opt-in at the Kernel level. While it greatly increases the virtual address space available, every pointer also has to go through an extra layer of indirection in terms of the PML5 table.

Page tables live in memory, but most recently used will be cached - there's a small cost in this case, but if part of a page table is not in cache, it must be fetched from memory, which has a big impact on latency. We could increase cache size too, but bigger caches also typically result in higher latencies.

So bigger addresses = bigger latency. It's a trade-off. Obviously, if we had the full 64-bit addressing, we'd need 6-level paging, resulting in higher latency, or bigger page tables, meaning we'd need even larger caches.

On Linux, even with 5LP enabled, normal allocation will not occur past 48-bits. If you mmap a page, you need to give an address larger than 248 as a hint, otherwise it will not allocate in this upper range. Unless you have a specific need for huge memory, you're best sticking to 4-level paging.

One way we can reduce latency is by allocating bigger pages via MAP_HUGE*. Huge pages don't need to access all levels of page tables - but they may increase fragmentation of physical memory.

1

u/KingOfZero 23d ago

We switched to huge pages in our latest release of OpenVMS for various kernel memory including other PTEs. It seems to be helpful. We don't allow huge pages for user applications.

0

u/TheologyFan 25d ago edited 24d ago

281474976710656 (2^48) bytes is plenty of ram for now. Some day it might not be but for now it is far more than enough. Before 32 bit addressing there was 20 bit addressing back when 1 mb was a lot of ram. The trade offs of larger address space don’t need to be made if you can’t physically produce that much ram.

What are those trade offs? Modern computers use virtual memory so each program can think it has access to all of the memory (and a verity of other benefits). This means you need to store a mapping from virtual to physical memory and in 32 bit addressing this was achieved with 2 level page tables. With 48 bit addressing 4 level page tables are used, 64 bit addressing would need even more levels. More levels is slower because the memory management unit (MMU) needs to traverse these page table levels.

1

u/pete_68 24d ago

I have it on good authority that nobody will ever need more than 640K. /s

1

u/[deleted] 24d ago

640K GB is a lot of RAM! You could probably run two Crysis with it.

1

u/proc-sysrq 24d ago

Intel 5 level paging supports 52 bits of addressable RAM, in the next 5 years precisely who's going to be stacking up 4PiB servers over scaling horizontally?

1

u/pellets 23d ago

The one place I could see more than 48 bits of memory being useful would be global addressing in a data center setting. Super computers, I imagine, have custom software and/or hardware to deal with this.

0

u/avaneev 24d ago

Just filling this amount of RAM with zeroes takes 45 minutes at current mem speeds.

1

u/Inevitable-Study502 23d ago

hmm..isnt it faster to just let RAM reset naturaly?

1

u/amejin 23d ago

Not if you want to be cryptographically secure…

0

u/rocqua 24d ago

Upvoting.

This is the first answer that explains an actual downside to having more memory addressable: page table lookups get more expensive.

-3

u/aka1027 25d ago

A quick googling yields,

ā€œBecause that's all that's needed. 48 bits give you an address space of 256 terabyte. That's a lot. You're not going to see a system which needs more than that any time soon.ā€

Stack overflow

0

u/CypherAus 25d ago

Coz 48 is huge and 57 is huge-er. 64 is just not needed.

0

u/Altruistic-Rice-5567 25d ago

Ethernet physical addresses were created long before we had 64-bit computers as common. It was probably already a cost stretch to go with 48-bits.

0

u/Greedy-Thought6188 24d ago

Technically we're not even blocked by 64 bits. We can just introduce an extension that allows entries in late tables to be however large we want. Virtual memory would be slightly more tedious but that can also be done. The cost and the speed of access are a bigger concern.

0

u/mckenzie_keith 24d ago

There is no RAM that big. Each bit of address doubles the size of the RAM. The high order address bits would not have anything to connect to. Designing the CPU to support 64 bit addressing would not be a big deal. Actually having that much RAM is. So they stop at whatever they think is a reasonable number of bits for the foreseeable future.

0

u/stevekez 24d ago

We use the extra bits for other purposes seeing as we can't have that much physical RAM to address. Tags and authentication codes amongst other things.

0

u/force_disturbance 24d ago

The physical addresses are for the CPU (or some small number of CPUs) to read/write real physical RAM. That RAM must be close to the CPU, typically on the mainboard. You literally can't fit the RAM to answer all those addresses in a single computer (or even single room)

You'd need 64 million of the absolutely densest RAM sticks we could make, and all of those directly connected to the CPU.

0

u/rennurb3k 24d ago

Even if you had all the ram , the main reason is that each process get its own isolated memory tree ( or in case of fork an on demand version with cow)

0

u/hansendc 24d ago

It’s pure economics. Pure opportunity cost.

Each physical address bit costs physical wires. A literal physical wire from the CPU to the memory system. It is a waste of space that could be used for better things to make your computer faster.

There are also lots of physical addresses plumbed all over the CPU. A bigger physical address means more silicon to store these bits and bigger, deeper, slower logic to process the addresses.

ā€œCheatingā€ by making the address sizes smaller makes the computer faster.

P.S. Do not get me started on virtual addresses. They aren’t really 64-bits either. The canonicality hole causes all kinds of fun for software.

-1

u/TheMrCurious 25d ago

Search YouTube

0

u/Select-Reason6584 23d ago

There is no RAM configuration of this size. We're not going to add pins and traces that have nothing to connect to.

0

u/Fickle_Draw9848 23d ago

This RAM capacity isn't manufactured in the first place. Why add pins and traces that will never be used?

0

u/[deleted] 24d ago

Suppose my PC had 2**64 bytes of memory and I wanted to scan that memory, a 64-bit word at a time, and add up all the values.

Doing that for 2GB (requiring 31 address bits) takes about 1 second. For 64 bits' worth, which needs 33 extra address bits, it would take 2**33 seconds.

That's about 270 years. So even if I had it available, I wouldn't live long enough to do much with it!

Since I have 8GB RAM, that would be 2**31 more than I have a present, which is also 2 billion times more in cost, size, weight, power, heat and every other measure you could think of.