Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Software Linux

Linux x32 ABI Not Catching Wind 262

jones_supa writes "The x32 ABI for Linux allows the OS to take full advantage of an x86-64 CPU while using 32-bit pointers and thus avoiding the overhead of 64-bit pointers. Though the x32 ABI limits the program to a virtual address space of 4GB, it also decreases the memory footprint of the program and in some cases can allow it to run faster. The ABI has been talked about since 2011 and there's been mainline support since 2012. x32 support within other programs has also trickled in. Despite this, there still seems to be no widespread interest. x32 support landed in Ubuntu 13.04, but no software packages were released. In 2012 we also saw some x32 support out of Gentoo and some Debian x32 packages. Besides the kernel support, we also saw last year the support for the x32 Linux ABI land in Glibc 2.16 and GDB 7.5. The only Linux x32 ABI news Phoronix had to report on in 2013 was of Google wanting mainline LLVM x32 support and other LLVM project x32 patches. The GCC 4.8.0 release this year also improved the situation for x32. Some people don't see the ABI as being worthwhile when it still requires 64-bit processors and the performance benefits aren't very convincing for all workloads to make maintaining an extra ABI worthwhile. Would you find the x32 ABI useful?"
This discussion has been archived. No new comments can be posted.

Linux x32 ABI Not Catching Wind

Comments Filter:
  • It's not only RAM (Score:5, Informative)

    by jandar ( 304267 ) on Tuesday December 24, 2013 @07:41PM (#45779071)

    The company I work for compiles almost all programms with 32 bits on x86-64 CPUs. It's not only cheap RAM usage, it's also expensive cache which is wasted with 64 pointer and 64 bit int. Since 3 GB is much more than our programms are using, x86-64 would be foolish. I'm eager waiting for a x32 SuSE version.

  • Re:Nice concept (Score:3, Informative)

    by maswan ( 106561 ) <(wm.wm.nawsam) (ta) (2todhsals)> on Tuesday December 24, 2013 @07:54PM (#45779133) Homepage

    The main benefit is that it runs faster. 64-bit pointers take up twice the space in caches, and especially L1 cache is very space-limited. Loading and storing them also takes twice the bandwidth to main memory.

    So for code with lots of complex data types (as opposed to big arrays of floating point data), that still has to run fast, it makes sense. I imagine the Linux kernel developers No1 benchmark of compiling the kernel would run noticably faster with gcc in x32.

    The downside is that you need a proper fully functional multi-arch system like is slowly getting adopted by Debian in order to handle multiple ABIs. And then you get into iffy things on if you want the faster /usr/bin/perl or one that can handle 6-gig lists efficiently...

  • by mjrauhal ( 144713 ) on Tuesday December 24, 2013 @08:32PM (#45779307) Homepage

    Yes it would. That's among the nontrivial maintenance costs.

  • Re:Subject (Score:4, Informative)

    by Reliable Windmill ( 2932227 ) on Tuesday December 24, 2013 @08:45PM (#45779391)
    You've not understood this correctly. x32 is an enhancement and optimization for executable files that do not require gigabytes of RAM, primarily regarding performance. It has nothing to do with the availability or lack of RAM in the system, or how much RAM costs to buy in the computer store.
  • Re:Subject (Score:5, Informative)

    by dmbasso ( 1052166 ) on Tuesday December 24, 2013 @09:32PM (#45779651)

    Which is all nice and good except this implies your data structure was mostly pointers to begin with

    And that's exactly the case of scripting languages, where every structure (say, a Python object) is a collection of pointers to methods and data.

  • Re:no (Score:4, Informative)

    by Just Brew It! ( 636086 ) on Tuesday December 24, 2013 @10:14PM (#45779849)
    For most embedded applications you're probably better off just running a 32-bit OS and calling it a day. Embedded is mostly on 32-bit ARM processors anyway.
  • Re:Subject (Score:5, Informative)

    by Forever Wondering ( 2506940 ) on Wednesday December 25, 2013 @12:03AM (#45780287)

    With x32 you get:
    - You get 16 registers instead of 8. This allows much more efficient code to be generated because you don't have to dump/reload automatic variables to the stack because the register pressure is reduced.
    - You also get a crossover from the 64 bit ABI where the first 6 arguments are passed in registers instead of push/pop on the stack.
    - If you need a 64 bit arithmetic op (e.g. long long), compiler will gen a single 64 instruction (vs. using multiple 32 ops).
    - You also get the RIP relative addressing mode which works great when a lot of dynamic relocation of the program occurs (e.g. .so files).

    You get all these things [and more] if you port your program to 64 bit. But, porting to 64 bit requires that you go through the entire code base and find all the places where you said:
        int x = ptr1 - ptr2;
    instead of:
        long x = ptr1 - ptr2;
    Or, you put a long into a struct that gets sent across a socket. You'd need to convert those to int's
    Etc ...

    Granted, these should be cleaned up with abstract typedef's, but porting a large legacy 32 bit codebase to 64 bit may not be worth it [at least in the short term]. A port to x32 is pretty much just a recompile. You get [most of] the performance improvement for little hassle.

    It also solves the 2037 problem because time_t is now defined to be 64 bits, even in 32 bit mode. Likewise, in struct timeval, the tv_sec field is 64 bit

  • Re:Subject (Score:4, Informative)

    by TheRaven64 ( 641858 ) on Wednesday December 25, 2013 @06:15AM (#45781119) Journal
    The C standard does not guarantee that sizeof(long) is as big as sizeof(void*). The type that you want is intptr_t (or ptrdiff_t for differences between pointers). If you've gone through replacing everything with long, then good luck getting your code to run on win64 (where long is 4 bytes).

The key elements in human thinking are not numbers but labels of fuzzy sets. -- L. Zadeh

Working...