Xen Linode with Gentoo

Hi, i just move to Xen, and after upgrade some packages of my installation with: emerge -avuND world, i just got this message:

  • Messages for package sys-libs/glibc-2.6.1:

  • You are using Xen but don't have -mno-tls-direct-seg-refs in your CFLAGS.

  • This will result in a 50% performance penalty, which is probably not what you want.

so, i need to put that line in the make.conf:

CFLAGS="-O2 -march=i686 -pipe -mno-tls-direct-seg-refs"

and after that, run: emerge -ae world that has:

Total: 109 packages (109 reinstalls), Size of downloads: 11,046 kB

is that really needed? or is just something that will be done on the dom0 side?.

4 Replies

Wow… Does that mean Gentoo Linodes will be twice as fast as any other distro, since I'm assuming the binaries aren't compiled with that option by default?

> On 32-bit x86 platforms, Xen uses segmentation to provide protection of the memory used for the hypervisor. This results in some performance issues since wrap-around segments as used by glibc need expensive extra handling. For more information on how Xen uses segmentation, see XenSegments.

It is possible to rebuild glibc so that it only uses segments such that there is no performance penalty. To do this, you need to apply the patch below to the glibc sources and then rebuild glibc with the -mno-tls-direct-seg-refs option.

This patch is not needed for glibc-2.4. It automatically accesses the segments correctly when it detects that it is compiled with the -mno-tls-direct-seg-refs option.

http://wiki.xensource.com/xenwiki/XenSpecificGlibc

Interesting. The Gentoo Xen doc does say to rebuild world after adding this flag: http://www.gentoo.org/doc/en/xen-guide.xml

I also run Gentoo on my Linode… wondering, though, if I really want to do this. If anything, my system seems faster on Xen than it did on UML.

I did also change CFLAGS and MAKEOPTS for Xen, since we get Xeon processors, and more of them:

CFLAGS="-march=prescott ..."
MAKEOPTS="-j5"

Well, I don't know that it was needed, or that it improved performance (things "feel" the same, and I was not motivated enough to take before and after benchmarks), but I did emerge -e world using these CFLAGS and MAKEOPTS:

CFLAGS="-march=prescott -fomit-frame-pointer -O2 -pipe -mno-tls-direct-seg-refs"
MAKEOPTS="-j5"

256 packages were rebuilt, I rebooted, and everything is fine. Anyway, posting this just to say it appears "safe" to do this.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct