Which OS/distributions have 64-bit kernel and 32-bit userspace? [closed]

Which OS (or distributions) comes with 64-bit kernels (x86_64, SPARC64, PPC64, ..smth else?..) and 32-bit userland?

I want all small userspace programs (like ls, cat, etc) to be 32-bit, because they really no needs to be 64-bit. But OS kernel must be 64bit for using >=3 Gb of RAM. Also database programs (when using a lot of memory) can be 64bit.

64bit mode can hurt some programs, makes them bigger, eating (wasting) memory on pointers (especially in big abstract datatypes like list, tree, etc).

64 bit programss WASTES twice memory on EACH Pointer. I don't want it.

And the Question is not "Are the 32-bit programs needed when 64-bit porcessor is available". Question is "What OS comes with 32 bit userspace and kernels in 32/64 bit mode". Examples of such OS includes: Solaris/SPARC64, MACOSX/X86_64 (10.5)/....


Solution 1:

Current consensus seems to be that you are worrying needlessly. 64-bit is fine, and do not take up much more space than 32-bit to be of any significance. On a couple of my systems here:

What    64-bit Size 32-bit Size
/bin/ls        101K         91K
/lib/libc.so   1.4M        1.3M
/usr/bin/php5  5.5M        5.1M

See – not that significant. Also, 64-bit pointers are more useful than you might think.

Solution 2:

I could almost buy that you would benefit from a 64-bit kernel and 32-bit userspace more than you'll lose time discussing it. Which can, of course, sometimes be true (I do that for a redis server).

But if you want to start mixing 64-bit and 32-bit binaries as you mentioned in a comment, you're really looking for trouble. That would mean that a lot of libraries would be mapped twice in memory, which would be quite inefficient. No distribution offers that (even the Debian multiarch project doesn't cover binaries).

You refer to binaries like "cat", "dd", "bash", even "gcc" as not needing 64 bits, but those are typical examples of programs where using 32-bit pointers instead of 64-bit ones will not save "anything". You already lost more time typing cat in your message than you could ever save by running a 32-bit version of it instead of 64-bit.

Not to mention that x86_64 doesn't only have bigger pointers, it also has twice as many generic registers, and compilers can make as many assumptions about available extensions as with i686 (which is more than i586, in turn more than i486, in turn more than i386). Performance can end up being measurably better.

If you want to use both 64-bit and 32-bit binaries, my personal recommendation would be to run the (likely very few) pointer-intensive applications needing less than 4GB of RAM and for which you truly care about performance in a 32-bit chroot (or any container). Unless they're running on a Java stack, in which case you'll probably be better off sticking to a 64-bit userspace and use a hybrid JVM (with compressed pointers).

If you really want a 64-bit kernel and a 32-bit userspace, and not only because you read somewhere that it'd have a better performance, you can always take the kernel from the 64-bit packages of your distribution and squeeze it on a 32-bit install.

Solution 3:

There's a new X32 ABI in the works which is aimed at exactly what you're looking for: 32-bit userspace with a 64-bit kernel on AMD64 hardware. The advantage of X32 over the traditional i386 ABI is that programs can take advantage of other features of the AMD64 architecture, such as new instructions and additional CPU registers.

However, X32 isn't ready for use yet, so your best bet at the moment is to install a 32-bit distro that has a 64-bit kernel available. In Debian, for example, you'd install linux-image-2.6-amd64 (or linux-image-amd64 if you're running wheezy, which isn't released yet, but uses a 3.x kernel).

Solution 4:

I'm running an 64bit KVM server, which is hosting several virtual servers (debian/woody - debian/sqeeze and Windows XP). the virtual linux-server have 32bit Userland and an 64bit kernel (aptitude install linux-image-2.6-amd64).

So I think you can install every current linux distro and run an 64bit kernel on it - I have no problem with this setup.