Why you don’t need a 64bit kernel

in Tech Stuff

So, we have a bunch of people popping into #apple right now, asking how they can get a 64bit kernel in Snow Leopard.

Really, you don’t need one, and here’s why – straight from the Apple documentation:

64-Bit Kernel

Mac OS X v10.6 includes a 64-bit kernel. Although Mac OS X allows a 32-bit kernel to run 64-bit applications, a 64-bit kernel provides several benefits:

The kernel can better support large memory configurations.

Many kernel data structures such as the page table get larger as physical RAM increases. When using a 32-bit kernel with more than 32 GB of physical RAM, these data structures can consume an unmanageably large portion of the 4 GB kernel address space.

By moving to a 64-bit kernel, the 4 GB kernel address space limitation is eliminated, and thus these data structures can grow as needed.

The maximum size of the buffer cache is increased, potentially improving I/O performance.

A 32-bit kernel is limited in its ability to cache disk accesses because of the 4 GB kernel address space limit.

With a 64-bit kernel, the buffer cache can grow as needed to maximize the use of otherwise unused RAM.

Performance is improved when working with specialized networking hardware that emulates memory mapping across a wire or with multiple video cards containing over 2 GB of video RAM.

With a 32-bit kernel, if the combined physical address space (video RAM, for example) of all of your devices exceeds about 1.5 GB, it is impossible to map them fully into a 32-bit kernel address space at the same time. To work around this limitation, driver writers must map smaller apertures of that physical address space into the kernel’s address space.

When such a driver needs to write to or read from an unmapped address on the device, it must unmap an existing region, then map in the new region. Depending on how the mappings are managed, this extra process may cause a performance penalty, particularly for clients that exhibit low locality of reference.

With a 64-bit kernel, the entire device can be mapped into the kernel’s address space at once. This improves performance by removing the extra overhead of mapping and unmapping regions of memory. It also removes the burden of managing these mappings in your driver code, thus making the drivers simpler and less likely to generate panics by unmapping the wrong memory at the wrong time.

So, there you go. Unless you have more than 32GB ram, or you have more than one video card in your machine, you’re not going to see any difference at all. You might see some improvement in IO performance, if you have more than 4GB ram, but really I doub’t thats going to be a huge difference.

But really the main reason why 32bit is the default on Snow Leopard, is because the userland is not ready yet. Almost all third party applications are still 32bit, and almost all third party kernel extensions are 32bit. You might gain a tiny bit of IO performance … and lose a whole lot of functionality.

So, unless you are prepared to lose all that functionality, stick with the 32bit kernel. In year or so once everyone has released 64bit versions of their drivers, then it might make sense to boot 64bit – if you have loads of ram.

edit: Obviously, any 32bit or 64bit app will work with either kernel. And if you see a real need for it, go for it. Just, don’t stress over it – in most cases, the general user won’t need the 64bit kernel just yet. There’s a reason that it’s not the default kernel.

7 Comments

7 Comments

  1. Interesting commentary. I have a Mac Pro with 10Gb of RAM and was wondering if the 64-bit kernel would benefit me. It seems that it probably won’t though based on the cases above.

  2. This article does not go in-depth enough and is way to vague to make such a bold statement as sticking with a 32 bit kernel. It assumes you are Joe Average user and not a high-end user for the most part. That is why I know from first hand experience that 64 bit kernel and OS is the only way to go if you use high-end applications. I am a 3D artist and use programs that can take advantage of such since they are now written in 64 bit. The more memory I have the better off I am if the applications and OS support it. Programs such as Cinema 4D and others are the ones I use and soon others will be 64 bit too. Right now though, some are just 64 bit on the Windows 7 platform and I can tell you it makes a HUGE difference in time it takes to do renders of art and animations.

    For the average user, maybe, but I will certainly be wanting FULL 64 bit support in Snow Leopard which means using the 64 bit kernel.

  3. Well, Geoff. That was his point. Unless a person is running apps like you, at this point in time 64 bit is not going to be the norm now is it?…

  4. Tom Schmidt

    This article makes it sound like 32 bit applications will not run under a 64 bit kernel. Not true. Only things that wouldn’t work would be 32 bit kernel extensions.

  5. You can still run 64-bit applications on the 32-bit kernel, with access to plenty of memory. This blog is just talking about the kernel, not the applications. Two different issues.

    Another advantage in running the 32-bit kernel (and applications) is that they will often run a bit faster. Other things being equal, 64-bit code is a little slower for applications which cannot benefit from 64-bit operation. Basically there are more bits to shuttle around. Having a 64-bit application is only an advantage if the application actually needs the capabilities. If you’re trying to edit multi-gigabyte image files, that might be one such situation. But that’s certainly atypical at the present time.

  6. Wow, never had this many comments.

    The post is directed at most users. If you have a genuine need for 64bit kernel, or see some performance increase that is worth the effort, then go for you life. Mere mortals should stick to the 32bit kernel, however.

    Obviously, 32bit and 64bit apps will work with either kernel.

Leave a Reply

Using Gravatars in the comments - get your own and be recognized!

XHTML: These are some of the tags you can use: <a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>