Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I do wonder in today’s landscape of single board computers what the right bit width is. A 64-bit system with like 1-2GB or RAM doesn’t make a ton of sense since your program size and data structure size grows by quite a bit but you don’t need it to since you don’t get to have more than 4GB of RAM. On the other hand there you do have SBCs with 8-16GBs of RAM but that’s a far cry from needing full 64 bits. Would an optimal bit width be 48 bits? 40?


32-bit ARM-based systems supported up to 1 TB of RAM. 32-bit x86 only up to 64 GB. Unless you want to map more than 4 GB in a single process, you could very well stay 32-bit.

But AArch64 (or ARM64) and AMD64 did bring a lot more on the table than just larger address space. More registers, and a performance boost by just being better suited for the modern CPU core design.


32-bit x86 linux will typically support 3GB per process, with 1GB kernel address area, I think? (Windows did 2GB / 2GB split by default, custom boot options can change it to 3GB / 1GB, but only some 32-bit apps fully supported it, like photoshop).

Also, FWIW, security people can get real bothered that ASLR doesn't do much in 32-bit systems.

So, I think starting around 2GB DRAM, it's probably a "big enough" system to justify a 64-bit OS.


On 32 bit you can of course make the kernel higher half, but yes AFAIK most mainstream kernels chose higher quarter to grant more vaddr space to processes.


>Unless you want to map more than 4 GB in a single process, you could very well stay 32-bit.

Provided you are not bothered by highmem. https://www.realworldtech.com/forum/?threadid=76912&curposti...


I didn't notice who wrote that initially, and was getting annoyed with his failure to notice that it's not HIGHMEM.SYS, it's HIMEM.SYS.

But why should Linus, even in 2007, use Win9x in the 21st century?


> But AArch64 (or ARM64) and AMD64 did bring a lot more on the table than just larger address space. More registers, and a performance boost by just being better suited for the modern CPU core design.

There is the x32 ABI - 32-bit pointer length, but the AMD64 ISA. I don’t think it ever saw significant adoption though.


32 bit gave you that much with PAE, which has its own set of unfortunate problems.

I still think it's pretty safe to say 64 bit is the future, and will be for a long time (if I live long enough for 128 bit processors to become defacto or even widely necessary I'll be truly shocked).


Many "64-bit" systems only have ~48 bits of virtual address space, and while canonical pointers have all the high bits equal, you can put the otherwise-wasted bits to work by storing metadata.

If you're writing really space-optimised code, you can pack pointers closer together.


Yes, this already happens. Address bus width is usually different from register width due to cost. I found this, old CPU's address bus only getting to 44 bits wide on Itanium.

https://www.tech-faq.com/address-bus.html

My newish AMD laptop: `grep 'address sizes' /proc/cpuinfo`

    address sizes : 48 bits physical, 48 bits virtual
Looks like 36 bits wide is already plenty for anything typical, up to 68 GB:

    >>> f'{2**32:>30_}'
    '                 4_294_967_296'
    >>> f'{2**36:>30_}'
    '                68_719_476_736'
    >>> f'{2**40:>30_}'
    '             1_099_511_627_776'
    >>> f'{2**48:>30_}'
    '           281_474_976_710_656'
    >>> f'{2**64:>30_}'
    '    18_446_744_073_709_551_616'


I guess no point wasting hardware supporting things that will never be possible for the lifetime of the processor.


AMD64 mandates 48bit virtual addressing minimum, with the rest sign-extended unless certain optional features are enabled.


For embedded uses, 1GB is certainly big enough to not need to be 32-bit, so it makes sense IMO to use the same 64-bit binaries/toolchains/BSPs as larger platforms, especially since they're better supported by upstreams now.


42-bit is the right answer of course.


I think it's either 8, 32 or 64 bit. Maybe 16 bit.

The size of memory space is not necessarily aligned with the bit width of the CPU. There are a lot of 32 bit systems that can use much more than 4 GB of RAM. And there are no 64 bit systems I know of, that are even theoretically able to use 16 exabytes (16 million TB) of RAM.

AFAIK ARM32 is still the norm for embedded systems. And there is still a place for 8-bit microcontrollers.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: