* [gentoo-user] x32 ABI
@ 2012-07-30 16:40 Alecks Gates
2012-07-30 16:55 ` Alan McKinnon
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Alecks Gates @ 2012-07-30 16:40 UTC (permalink / raw
To: gentoo-user
After a recent update to binutils 2.22 I started to look into the x32
ABI support. It looks very interesting and I am thinking about
installing it via the experimental stage3[1], but I have some
questions to ask first.
What are the benefits and drawbacks of using the x32 ABI, other than
the obvious "experimental" cautions? I currently do not have a
computer with more than 4GB of ram, and one only has 2GB (used as a
media center).
How do I go about installing an x32 ABI system? Is it as simple as
using the x32 stage3 and enabling CONFIG_X86_X32 in the kernel, or is
there more to it? How would I convert a running system to the x32
ABI, if possible?
Alecks
[1] http://distfiles.gentoo.org/experimental/amd64/x32/
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] x32 ABI
2012-07-30 16:40 [gentoo-user] x32 ABI Alecks Gates
@ 2012-07-30 16:55 ` Alan McKinnon
2012-07-30 17:11 ` Volker Armin Hemmann
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Alan McKinnon @ 2012-07-30 16:55 UTC (permalink / raw
To: gentoo-user; +Cc: alecks.g
On Mon, 30 Jul 2012 11:40:50 -0500
Alecks Gates <alecks.g@gmail.com> wrote:
> After a recent update to binutils 2.22 I started to look into the x32
> ABI support. It looks very interesting and I am thinking about
> installing it via the experimental stage3[1], but I have some
> questions to ask first.
>
> What are the benefits and drawbacks of using the x32 ABI, other than
> the obvious "experimental" cautions? I currently do not have a
> computer with more than 4GB of ram, and one only has 2GB (used as a
> media center).
>
> How do I go about installing an x32 ABI system? Is it as simple as
> using the x32 stage3 and enabling CONFIG_X86_X32 in the kernel, or is
> there more to it? How would I convert a running system to the x32
> ABI, if possible?
Your first step should be to read flameeye's blog on the matter,
then decide. It's nowhere near at awesome as Intel makes out.
You can find the blog on the front page of gentoo.org under the name
Diego
>
> Alecks
>
> [1] http://distfiles.gentoo.org/experimental/amd64/x32/
>
--
Alan McKinnon
alan.mckinnon@gmail.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] x32 ABI
2012-07-30 16:40 [gentoo-user] x32 ABI Alecks Gates
2012-07-30 16:55 ` Alan McKinnon
@ 2012-07-30 17:11 ` Volker Armin Hemmann
2012-07-30 20:42 ` Walter Dnes
2012-07-31 2:53 ` Nikos Chantziaras
3 siblings, 0 replies; 12+ messages in thread
From: Volker Armin Hemmann @ 2012-07-30 17:11 UTC (permalink / raw
To: gentoo-user; +Cc: Alecks Gates
Am Montag, 30. Juli 2012, 11:40:50 schrieb Alecks Gates:
> After a recent update to binutils 2.22 I started to look into the x32
> ABI support. It looks very interesting and I am thinking about
> installing it via the experimental stage3[1], but I have some
> questions to ask first.
>
> What are the benefits and drawbacks of using the x32 ABI, other than
> the obvious "experimental" cautions? I currently do not have a
> computer with more than 4GB of ram, and one only has 2GB (used as a
> media center).
>
> How do I go about installing an x32 ABI system? Is it as simple as
> using the x32 stage3 and enabling CONFIG_X86_X32 in the kernel, or is
> there more to it? How would I convert a running system to the x32
> ABI, if possible?
>
> Alecks
>
> [1] http://distfiles.gentoo.org/experimental/amd64/x32/
how about: almost zero benefits and lots and lots of downsides?
It was only introduced because ATOM sucks so much in 'real' 64bit mode.
--
#163933
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] x32 ABI
2012-07-30 16:40 [gentoo-user] x32 ABI Alecks Gates
2012-07-30 16:55 ` Alan McKinnon
2012-07-30 17:11 ` Volker Armin Hemmann
@ 2012-07-30 20:42 ` Walter Dnes
2012-07-31 2:47 ` [gentoo-user] " Nikos Chantziaras
2012-07-31 2:53 ` Nikos Chantziaras
3 siblings, 1 reply; 12+ messages in thread
From: Walter Dnes @ 2012-07-30 20:42 UTC (permalink / raw
To: gentoo-user
On Mon, Jul 30, 2012 at 11:40:50AM -0500, Alecks Gates wrote
> What are the benefits and drawbacks of using the x32 ABI, other than
> the obvious "experimental" cautions? I currently do not have a
> computer with more than 4GB of ram, and one only has 2GB (used as a
> media center).
In theory, real life is identical to theory. In real life, real life
is different from theory. A 32-bit system can directly address 4 gigs
of memory. The problem is that the 4 gigs includes your video ram. So
you lose part of the top end of your 4 gigs of ram, to make room for
your video card's ram. This is true for both linux and Windows. A bit
over 3 gigs is the effective memory max for 32-bit systems.
32-bit linux can access the extra ram for data storage, via some
jumping through flaming hoops, but it's slower than direct addressing
via 64-bit mode. If you have 4 gigs on a machine, it's a candidate for
64-bit mode.
--
Walter Dnes <waltdnes@waltdnes.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [gentoo-user] Re: x32 ABI
2012-07-30 20:42 ` Walter Dnes
@ 2012-07-31 2:47 ` Nikos Chantziaras
2012-07-31 4:21 ` Walter Dnes
0 siblings, 1 reply; 12+ messages in thread
From: Nikos Chantziaras @ 2012-07-31 2:47 UTC (permalink / raw
To: gentoo-user
On 30/07/12 23:42, Walter Dnes wrote:
> On Mon, Jul 30, 2012 at 11:40:50AM -0500, Alecks Gates wrote
>
>> What are the benefits and drawbacks of using the x32 ABI, other than
>> the obvious "experimental" cautions? I currently do not have a
>> computer with more than 4GB of ram, and one only has 2GB (used as a
>> media center).
>
> In theory, real life is identical to theory. In real life, real life
> is different from theory. A 32-bit system can directly address 4 gigs
> of memory. The problem is that the 4 gigs includes your video ram. So
> you lose part of the top end of your 4 gigs of ram, to make room for
> your video card's ram. This is true for both linux and Windows. A bit
> over 3 gigs is the effective memory max for 32-bit systems.
>
> 32-bit linux can access the extra ram for data storage, via some
> jumping through flaming hoops, but it's slower than direct addressing
> via 64-bit mode. If you have 4 gigs on a machine, it's a candidate for
> 64-bit mode.
>
That's a problem with x86, not x32. x32 is a 64-bit mode. It's a new
ABI :-)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [gentoo-user] Re: x32 ABI
2012-07-30 16:40 [gentoo-user] x32 ABI Alecks Gates
` (2 preceding siblings ...)
2012-07-30 20:42 ` Walter Dnes
@ 2012-07-31 2:53 ` Nikos Chantziaras
2012-07-31 3:39 ` Michael Mol
3 siblings, 1 reply; 12+ messages in thread
From: Nikos Chantziaras @ 2012-07-31 2:53 UTC (permalink / raw
To: gentoo-user
On 30/07/12 19:40, Alecks Gates wrote:
> What are the benefits and drawbacks of using the x32 ABI
Benefits: An x32 application is limited to a 32-bit address range but
runs in 64-bit CPU mode. The intent is to not waste any memory, but be
as fast as any other 64-bit application.
Drawbacks: Don't expect to get a fully working system. Many
applications will either not build, or break at runtime when compiled in
this mode. Also, some application will run slower because they come
with hand coded assembly routines for x86 and x86-64, but not for x32.
That means that generic C code paths will be used for x32, and they're
slower compared to the hand optimized assembly routines.
Also note that x32 is not compatible with 32-bit applications. If you
build an x86-64/x32 system, you lose the x86/x86-64 multilib capability
unless there's a way to have a three-way multilib Gentoo with
x86/x32/x86-64.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: x32 ABI
2012-07-31 2:53 ` Nikos Chantziaras
@ 2012-07-31 3:39 ` Michael Mol
2012-07-31 4:16 ` Alecks Gates
0 siblings, 1 reply; 12+ messages in thread
From: Michael Mol @ 2012-07-31 3:39 UTC (permalink / raw
To: gentoo-user
On Mon, Jul 30, 2012 at 10:53 PM, Nikos Chantziaras <realnc@gmail.com> wrote:
> On 30/07/12 19:40, Alecks Gates wrote:
>>
>> What are the benefits and drawbacks of using the x32 ABI
>
>
> Benefits: An x32 application is limited to a 32-bit address range but runs
> in 64-bit CPU mode. The intent is to not waste any memory, but be as fast
> as any other 64-bit application.
>
> Drawbacks: Don't expect to get a fully working system. Many applications
> will either not build, or break at runtime when compiled in this mode.
> Also, some application will run slower because they come with hand coded
> assembly routines for x86 and x86-64, but not for x32. That means that
> generic C code paths will be used for x32, and they're slower compared to
> the hand optimized assembly routines.
>
> Also note that x32 is not compatible with 32-bit applications. If you build
> an x86-64/x32 system, you lose the x86/x86-64 multilib capability unless
> there's a way to have a three-way multilib Gentoo with x86/x32/x86-64.
More specifically, x32 is not compatible with x86 (what we used to
call "32-bit applications on x86"...but since that's ambiguous, it's
better just to say "x86"). In practice, this means you won't be able
to link x32 ELF binaries against x86 ELF binaries.
You'll almost certainly be able to run x86/x32 multilib, since that's
at least part of the argument on behalf of it. But I have no idea when
that'll get set up. When it does, you'll probably be able to run
x86-64/x32/x86 multilib...but then you're compiling apps three ways,
and _that_ seems like it'll be excessive.
On a separate note, I generally recommend amd64 to people who have
processors which can handle it, even if they have as little as 1GB of
RAM. My reasoning is that having the large address space should reduce
memory fragmentation, which should in turn reduce apparent memory
bloat in long-lived applications.
--
:wq
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: x32 ABI
2012-07-31 3:39 ` Michael Mol
@ 2012-07-31 4:16 ` Alecks Gates
2012-07-31 4:43 ` Nikos Chantziaras
2012-08-04 18:07 ` Alecks Gates
0 siblings, 2 replies; 12+ messages in thread
From: Alecks Gates @ 2012-07-31 4:16 UTC (permalink / raw
To: gentoo-user
On Mon, Jul 30, 2012 at 10:39 PM, Michael Mol <mikemol@gmail.com> wrote:
> On Mon, Jul 30, 2012 at 10:53 PM, Nikos Chantziaras <realnc@gmail.com> wrote:
>> On 30/07/12 19:40, Alecks Gates wrote:
>>>
>>> What are the benefits and drawbacks of using the x32 ABI
>>
>>
>> Benefits: An x32 application is limited to a 32-bit address range but runs
>> in 64-bit CPU mode. The intent is to not waste any memory, but be as fast
>> as any other 64-bit application.
>>
>> Drawbacks: Don't expect to get a fully working system. Many applications
>> will either not build, or break at runtime when compiled in this mode.
>> Also, some application will run slower because they come with hand coded
>> assembly routines for x86 and x86-64, but not for x32. That means that
>> generic C code paths will be used for x32, and they're slower compared to
>> the hand optimized assembly routines.
>>
>> Also note that x32 is not compatible with 32-bit applications. If you build
>> an x86-64/x32 system, you lose the x86/x86-64 multilib capability unless
>> there's a way to have a three-way multilib Gentoo with x86/x32/x86-64.
>
> More specifically, x32 is not compatible with x86 (what we used to
> call "32-bit applications on x86"...but since that's ambiguous, it's
> better just to say "x86"). In practice, this means you won't be able
> to link x32 ELF binaries against x86 ELF binaries.
>
> You'll almost certainly be able to run x86/x32 multilib, since that's
> at least part of the argument on behalf of it. But I have no idea when
> that'll get set up. When it does, you'll probably be able to run
> x86-64/x32/x86 multilib...but then you're compiling apps three ways,
> and _that_ seems like it'll be excessive.
>
> On a separate note, I generally recommend amd64 to people who have
> processors which can handle it, even if they have as little as 1GB of
> RAM. My reasoning is that having the large address space should reduce
> memory fragmentation, which should in turn reduce apparent memory
> bloat in long-lived applications.
>
>
>
>
> --
> :wq
>
I have just started the process of installing Gentoo from scratch on
on my 2GB RAM machine, and am going to fully compare the two, probably
using Phoronix Test Suite unless someone here can give me some other
recommendations -- I don't do benchmarking and I like how you can do
the comparisons with OpenBenchmarking.org. Hopefully Phornoix Test
Suite runs properly, I suppose I'll have to install php and the like.
Anyway, I don't think anyone addressed this. What would be the
best/cleanest/quickest way to switch from x86-64 to x32 ABI? I'm
planning on just backing up the partition once I've got the x86-64
ready to go and doing a new from scratch install with x32... but I'd
love to know about an easier way.
Alecks
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: x32 ABI
2012-07-31 2:47 ` [gentoo-user] " Nikos Chantziaras
@ 2012-07-31 4:21 ` Walter Dnes
2012-07-31 5:02 ` Michael Mol
0 siblings, 1 reply; 12+ messages in thread
From: Walter Dnes @ 2012-07-31 4:21 UTC (permalink / raw
To: gentoo-user
On Tue, Jul 31, 2012 at 05:47:22AM +0300, Nikos Chantziaras wrote
> That's a problem with x86, not x32. x32 is a 64-bit mode. It's a
> new ABI :-)
The original poster asked...
> What are the benefits and drawbacks of using the x32 ABI, other
> than the obvious "experimental" cautions? I currently do not have
> a computer with more than 4GB of ram, and one only has 2GB (used as
> a media center).
x32 is a backwards compatability shim for use under 64-bit mode. The
point I was trying to make was that the minimum memory where 64-bit has
clear advantages is 4 gigs. If you have 3 gigs or less, you can stick
with 32-bit mode, and x32 libs become moot.
--
Walter Dnes <waltdnes@waltdnes.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [gentoo-user] Re: x32 ABI
2012-07-31 4:16 ` Alecks Gates
@ 2012-07-31 4:43 ` Nikos Chantziaras
2012-08-04 18:07 ` Alecks Gates
1 sibling, 0 replies; 12+ messages in thread
From: Nikos Chantziaras @ 2012-07-31 4:43 UTC (permalink / raw
To: gentoo-user
On 31/07/12 07:16, Alecks Gates wrote:
> I have just started the process of installing Gentoo from scratch on
> on my 2GB RAM machine, and am going to fully compare the two, probably
> using Phoronix Test Suite unless someone here can give me some other
> recommendations -- I don't do benchmarking and I like how you can do
> the comparisons with OpenBenchmarking.org. Hopefully Phornoix Test
> Suite runs properly, I suppose I'll have to install php and the like.
There's app-benchmarks/phoronix-test-suite. It's 3.8 rather than 4.0
though. I've no idea whether 4.0 has anything important in it though.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: x32 ABI
2012-07-31 4:21 ` Walter Dnes
@ 2012-07-31 5:02 ` Michael Mol
0 siblings, 0 replies; 12+ messages in thread
From: Michael Mol @ 2012-07-31 5:02 UTC (permalink / raw
To: gentoo-user
On Tue, Jul 31, 2012 at 12:21 AM, Walter Dnes <waltdnes@waltdnes.org> wrote:
> On Tue, Jul 31, 2012 at 05:47:22AM +0300, Nikos Chantziaras wrote
>
>> That's a problem with x86, not x32. x32 is a 64-bit mode. It's a
>> new ABI :-)
>
> The original poster asked...
>
>> What are the benefits and drawbacks of using the x32 ABI, other
>> than the obvious "experimental" cautions? I currently do not have
>> a computer with more than 4GB of ram, and one only has 2GB (used as
>> a media center).
>
> x32 is a backwards compatability shim for use under 64-bit mode. The
> point I was trying to make was that the minimum memory where 64-bit has
> clear advantages is 4 gigs. If you have 3 gigs or less, you can stick
> with 32-bit mode, and x32 libs become moot.
The only reason they're the "clear" advantages is because it's much,
much harder to adequately describe the advantages given in things such
as:
* Doubling the number of general-purpose registers. The compiler has a
_lot_ more wiggle room for efficiently arranging data during
execution.
* Doubling the number of SSE registers. You can process a lot more
data a lot more quickly without the round trip latency of getting to
your GPU.
* Decreasing the pressure on memory allocators to allocate memory in a
way that avoids fragmentation. This is a function of the larger
virtual address space, and has nothing to do with the amount of
physical memory you have.
* Changing the calling convention to reduce function prologues, and to
enable some fancy optimizations.
It's also commonly forgotten that a process's address space is divided
between userspace and kernelspace; the kernel takes its piece of your
process, too, meaning that even if you have 4GB of RAM, you can't
create a 3GB heap allocation or mmap 3GB of data. And that has nothing
to do with the architecture's mapping of your video card's memory into
your system's physical address space.
People pound on the "3-4GB of RAM, and you should use x86_64" because
it was the easiest way to justify x86_64 to people when it came out;
AMD didn't retain full compatibility with x86 when the processor is in
long mode, nor does the compatibility mode (which is what x86 ELF
binaries running under an x86_64 kernel) have all of the features of
the legacy x86 ISA. AMD discarded them for a variety of reasons, even
though it meant breaking compatibility with a lot of code that was out
there. These days, that doesn't seem like a big deal, but there was
doubt at the time as to whether or not AMD64 would take off. Even
Microsoft bet the wrong way on that one, initially announcing its only
64-bit platform would be Itanium.
To get around the bad press, people pointed to RAM. AMD64 long mode
carried real benefits over PAE for enterprise applications, and AMD's
parts kept things like instruction reordering, whereas Intel's Itanium
ditched it, hoping that compilers would cover the difference. So, for
enterprise, where you often had servers with a whopping 16GB of RAM
and terabytes of mmap()-able data, the improved address space was a
major boon.
Meanwhile, home users just kinda trotted along. It took Unreal's
developers complaining they needed to be able to fit gigabytes of
texture, object and model data into RAM before you really started
seeing AMD64 pick up steam on home systems. Even then, Windows desktop
users didn't get real 64-bit support until Vista. (Yes, there was a
64-bit version of XP, but driver support there was and is abysmal).
But by the time users started installing Vista, they'd already had 4GB
of RAM in their systems and were wondering why their BIOS POST
sequence would say they only had, say, 3.6GB.
So, again, people started pounding on the RAM barrier as a reason to
switch to AMD64. People in userland still didn't notice things like
additional registers, because they didn't (and don't) understand them.
It's not something they see as as part of their POST process or as a
visible part of a spec sheet, so it's not something they jockey over.
But it's far more important than whether a part has a 90nm feature
size or a 45nm feature size.
It's true enough; if you have enough RAM, you certainly should be
using x86_64. The opposite isn't true, though; even if you don't have
enough RAM to demand 64-bit pointers, that doesn't mean you shouldn't
be using x86-64.
--
:wq
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [gentoo-user] Re: x32 ABI
2012-07-31 4:16 ` Alecks Gates
2012-07-31 4:43 ` Nikos Chantziaras
@ 2012-08-04 18:07 ` Alecks Gates
1 sibling, 0 replies; 12+ messages in thread
From: Alecks Gates @ 2012-08-04 18:07 UTC (permalink / raw
To: gentoo-user
On Mon, Jul 30, 2012 at 11:16 PM, Alecks Gates <alecks.g@gmail.com> wrote:
-snip-
>
> I have just started the process of installing Gentoo from scratch on
> on my 2GB RAM machine, and am going to fully compare the two, probably
> using Phoronix Test Suite unless someone here can give me some other
> recommendations -- I don't do benchmarking and I like how you can do
> the comparisons with OpenBenchmarking.org. Hopefully Phornoix Test
> Suite runs properly, I suppose I'll have to install php and the like.
>
> Anyway, I don't think anyone addressed this. What would be the
> best/cleanest/quickest way to switch from x86-64 to x32 ABI? I'm
> planning on just backing up the partition once I've got the x86-64
> ready to go and doing a new from scratch install with x32... but I'd
> love to know about an easier way.
>
> Alecks
What would be the most worthwhile benchmarks to run, both inside and
outside of Phoronix Test Suite? I figured I should ask since I don't
have much knowledge on the subject and this stuff is new to me. Also
there is there some automated method of measuring RAM usage?
Alecks
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2012-08-04 18:09 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 16:40 [gentoo-user] x32 ABI Alecks Gates
2012-07-30 16:55 ` Alan McKinnon
2012-07-30 17:11 ` Volker Armin Hemmann
2012-07-30 20:42 ` Walter Dnes
2012-07-31 2:47 ` [gentoo-user] " Nikos Chantziaras
2012-07-31 4:21 ` Walter Dnes
2012-07-31 5:02 ` Michael Mol
2012-07-31 2:53 ` Nikos Chantziaras
2012-07-31 3:39 ` Michael Mol
2012-07-31 4:16 ` Alecks Gates
2012-07-31 4:43 ` Nikos Chantziaras
2012-08-04 18:07 ` Alecks Gates
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox