[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] When should I use '-mno-tls-direct-seg-refs' ?


On 06/12/2011 11:56 PM, Pandu Poluan wrote:
> Hello list!
> I'm trying to create a VM (Gentoo x86) on an x86_64 platform, but will
> later be migrated to a Pentium4 platform.
> When I was compiling glibc on the VM, I got the following warning
> (please excuse the Gentoo-ism, if any):
>  * You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS.
>  * This will result in a 50% performance penalty when running with a 32bit
>  * hypervisor, which is probably not what you want.
> I'm not really sure what that means, or what I'm supposed to do. So
> I'll really appreciate your confirmation of my thoughts:
> 1. If I want to run Gentoo x86 on a 32-bit platform (i.e., Pentium4
> physical processor), I need -mno-tls-direct-seg-refs in my CFLAGS
> 2. If I want to run Gentoo x86 on a 64-bit platform, I don't need
> -mno-tls-direct-seg-refs
> 3. If I want to run Gentoo amd64 on a 64-bit platform, the
> -mno-tls-direct-seg-refs arg is not relevant
> Am I getting those right?

From this site: http://en.gentoo-wiki.com/wiki/Xen


Some software, in particular the glibc TLS library, is implemented in a
way that will conflict with how Xen uses segment registers to circumvent
a limitation of 32-bit x86 hardware platforms, causing poor performance
whilst carrying out certain operations under Xen. This will result in a
~50% performance penalty running multi-threaded applications. To fix
this, you must compile your system with the '-mno-tls-direct-seg-refs' flag.

Edit your /etc/make.conf and add '-mno-tls-direct-seg-refs' to your
CFLAGS. This is similar to the Xen instructions to mv /usr/lib/tls
/usr/lib/tls.disabled, but instead removes the trapped (slow) opcodes
for every binary, not just glibc. If using the -Os flag (with any
<gcc-4), change it to -O2, as the compiler is known to produce broken
code otherwise.

Note: The '-mno-tls-direct-seg-refs' flag does not make sense on any
64bit system. For such systems you can skip the recompilation of the
whole world and just recompile glibc

You will also need to fix the CFLAGS for each domain you install. In
practice, however, you will do this only once and save the result as
your 'skeleton base' for all your domain Us. Following this articles
method of using binary packages built by the host will also save you time."

Hope this helps,

Jack Morgan
Pub 4096R/761D8E0A 2010-09-13 Jack Morgan <jack@xxxxxxxxxxx>
Fingerprint = DD42 EA48 D701 D520 C2CD 55BE BF53 C69B 761D 8E0A

Attachment: signature.asc
Description: OpenPGP digital signature

Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.