4 ms·
As others have noted the rant is from 2008, which is interesting because this was the transition point between wide spread adoption of 64 bit aware OSes from 32
by ChuckMcM 14y ago
As others have noted the rant is from 2008, which is interesting because this was the transition point between wide spread adoption of 64 bit aware OSes from 32 bit aware OSes [1]. You can see lots of folks who are just getting their feet wet with 64 bit Linux [2], and configured memory sizes are getting up over 4GB 'real' memory.
One of the wonderful things about 64 bit address spaces? You don't ever have to re-use an address. Once folks figure that out you can do some amazing things that would have seemed stupid in the 70's, you can hard code the address for every single library function on your machine. Can you even imagine how weird that would be? Linking time would be instantaneous, calling printf? its always at 0x10015081aaf10000, all of libc? starting at 0x1000000000000 and working up. One giant database of the 'standard place' to put every single function. Remember when the 32 bit OS would put the kernel at 0x80000000 ? You know right on the 2G border, above that, kernel space, below that user space.
Anyway, I completely concur that abstractions that worked before, work wonderfully today. But I also don't worry about an array of 100M items on a server in RAM anymore. Using mmap to map a 1G file into the address space? Not a problem.
Its interesting to watch the behavior of systems when they are essentially all in memory.
[1] http://www.tomshardware.com/reviews/vista-workshop,1775-3.html http://www.tomshardware.com/reviews/vista-workshop,1775-3.ht...
[2] http://blekko.com/ws/?q=64+bit+linux+%2Fdate%3D2008 http://blekko.com/ws/?q=64+bit+linux+%2Fdate%3D2008
- mrb 14y ago0x80000000 on Windows. Linux i386 sets the boundary at 0xc0000000 :) This is yet another aspect where Linux made a better choice than Windows, as this gives processes 3GB of virtual memory instead of only 2GB.
- mauvehaus 14y agoIncidentally, you can change this on Windows i386 in the boot.ini [1] file using the /3GB option. This is for exactly the case where you want your database software (for instance) to be able to address more user-mode memory. As you might imagine, it occasionally trips up badly written kernel-mode code that makes assumptions about what type of address it's dealing with based on whether the MSB is set or not. [1] http://support.microsoft.com/kb/833721 http://support.microsoft.com/kb/833721
- marshray 14y agoAh yes, I remember that 6 months of Moore's law where my Windows XP32 machine had 4GB of RAM. My code project grew to need the /3GB switch in order to compile successfully (until we just moved to 64 bit dev boxes).
- cmccabe 14y agoLinux can be configured to set the boundary at 0x80000000. 3G/1G might be more common, but "Linux" didn't make any choice at all here.
- mrb 14y agoLinux made a choice: the choice of what the default should be (3G/1G).
- Someone 14y ago0xC0000000 on Linux. Mac OS X i386 sets the boundary at 0x00000000 :) This is yet another aspect where Mac OS X made a better choice than Linux, as this gives processes 4GB of virtual memory instead of only 3GB. Seriously: there are trade offs everywhere. Initially, a 2/2 split seemed good enough, it makes it easier to dicsciminate between user and kernel addresses, the difference between 2GB and 3GB is not that high (about a year in my restatement of Moore's law "a bit of address space every 18 months"), and Microsoft values backward compatibility higher than Linux does.
- mrb 14y agoBut this extra 1GB, that Mac OS X's 4GB/4GB split has over a 3GB/1GB split, is very costly as it forces a page table switch for each syscall. This is extra overhead that Linux doesn't have. Ingo Molnar, who developed a 4GB/4GB patch for Linux, explained this performance hit: http://lwn.net/Articles/39283/ http://lwn.net/Articles/39283/ This reinforces the fact that Linux's choice seems to be the better tradeoff between what Windows and Mac OS X do.
- Flow 14y agoWould it be possible to change this in OS X without making the whole user-land incompatible?
- Someone 14y agohttp://blogs.msdn.com/b/oldnewthing/archive/2004/08/06/209840.aspx http://blogs.msdn.com/b/oldnewthing/archive/2004/08/06/20984...: "One of the adverse consequences of the /3GB switch is that it forces the kernel to operate inside a much smaller space. One of the biggest casualties of the limited address space is the video driver. To manage the memory on the video card, the driver needs to be able to address it, and the apertures required are typically quite large. When the video driver requests a 256MB aperture, the call is likely to fail since there simply isn't that much address space available to spare." As I said: there are trade offs everywhere. AFAIK, Linux has not found a magic way round this. For example, http://us.download.nvidia.com/XFree86/Linux-x86/173.14.12/README/chapter-09.html http://us.download.nvidia.com/XFree86/Linux-x86/173.14.12/RE... states: "The NVIDIA kernel module requires portions of the kernel's virtual address space for each GPU and for certain memory allocations. If no more than 128MB are available to the kernel and device drivers at boot time, the NVIDIA kernel module may be unable to initialize all GPUs, or fail memory allocations"
- haberman 14y ago> One of the wonderful things about 64 bit address spaces? You don't ever have to re-use an address. Never say never. Current x86-64 CPUs only support 48 bits of address space, which you could scan through in under two hours on a 2.5GHz machine (at 16 bytes/cycle). 48 bits is a lot, but not infinite. If and when it actually is 64 bits, that will be a different story. :)
- crpatino 14y agoAmen to that! I remember how wonderful it was to have this flat 32-bit address space, where each memory location could be unambiguously identified by a single numeric address, and you did not have to make any crazy distinctions between short and long pointers.
- ChuckMcM 14y agoTrue, the physically addressable memory is "only" 256TB but the virtual space is still 64 bits. The point in time when the 256TB becomes a problem is when your working set (stuff resident in memory) is ideally more than 256TB. We've got mostly 96GB machines and those are modestly hard to exhaust. I don't think even a 1TB physical memory machine would be exhaustible with our current data sets. Even today, reading in a 32GB index shard from SSD still takes a couple of minutes.