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

But 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/

This reinforces the fact that Linux's choice seems to be the better tradeoff between what Windows and Mac OS X do.



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/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"


Yes there is a workaround: use the vmalloc=xxx parameter to increase it to a value greater than 128MB. This will work in most cases where the reserved virtual space can almost always at least be increased up to 256MB. I had to use this parameter myself 7 years ago when I was running 50-100 QEMU VMs on a 32-bit host with 32GB RAM and PAE.

The only cases where vmalloc=xxx won't solve your virtual address space is in exceedingly rare software/hardware configuration (more than 100+ QEMU VMs, more than probably about 4 Nvidia GPUs since they seem to use ~64MB each).

So all in all, yes for 99%+ of users not running these rare configs, the 3GB/1GB split is just fine. Which is why Linux never changed this default. Microsoft has more problem with a 3GB/1GB split because their kernel is less space-optimized (mostly due to bad coding practices because too many Windows drivers/kernel developers assume that 2GB is available.) I maintain my opinion that 3GB/1GB is a better tradeoff.


Would it be possible to change this in OS X without making the whole user-land incompatible?




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

Search: