WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

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

To: xen-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Xen-users] When should I use '-mno-tls-direct-seg-refs' ?
From: Jack Morgan <jack@xxxxxxxxxxx>
Date: Mon, 13 Jun 2011 07:03:35 -0700
Delivery-date: Mon, 13 Jun 2011 07:05:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <BANLkTik3eDQYGrOw0q-4Q6jtB22ddBvSwA@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <BANLkTik3eDQYGrOw0q-4Q6jtB22ddBvSwA@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Lightning/1.0b2 Thunderbird/3.1.10
Pandu,

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

"TLS and CFLAGS

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
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>