Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Optimising Gentoo for Pentium-M cpu's
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Arioch84
n00b
n00b


Joined: 15 Jul 2004
Posts: 37

PostPosted: Sun Apr 03, 2005 3:13 am    Post subject: Optimising Gentoo for Pentium-M cpu's Reply with quote

Optimising Gentoo for Pentium-M cpu's

What's the point of this howto?

Even if you haven't touched a Gentoo box yourself, you'll probably know that Gentoo is quite famous because of it's major tweakability and ultra crispy performance. This howto should help you to tweak a default 'stable' install and reach an even higher performance level, by using a few tools from the 'testing/unstable' branche and still maintaining maximum stability.

The raison why we use these tools is because the version of gcc in the 'stable' branche doesn't support any Pentium-M optimisations at all.

If you don't run the 'stable' branche you can skip most of this howto and go straight to the final tweaking part.


What do I need to complete this howto?

  • You obviously need a Pentium-M powered laptop or desktop pc.
  • You will also need to emerge a few apps from the 'testing/unstable' branche: gcc, gcc-config and libstdc++-v3.
  • You'll need to re-bootstrap your toolchain.
  • Patience, bootstrapping your toolchain takes quite a while to complete.


Squeeze more performance out of your Pentium-M cpu, the stable way

This should be the easiest and safest way to get it done for those who don't want to risk any stability issues, although I can not guarantee anyting.

First off all we need to make sure we can emerge the listed packages. Unmasking these packages should be quite easy to do:

Code:

echo "sys-devel/gcc ~x86" >>/etc/portage/package.keywords
echo "sys-devel/gcc-config ~x86" >>/etc/portage/package.keywords
echo "sys-libs/libstdc++-v3 ~x86" >>/etc/portage/package.keywords


Syncing your portage tree now should be a very good idea:

Code:

emerge sync


When this is done we can start to actually re-bootstrap the toolchain.
Go grab a cup of coffee, go play a game or whatever suits your likes because it will take a while to complete. It took about 40 minutes on my Pentium-M 735 Dothan (1.6ghz, 2mb L2).

Code:

cd /usr/portage/scripts
sh bootstrap.sh && env-update && source /etc/profile


When this step is done you should make sure that Gentoo will now use the new compiler. Use gcc-config -l to check the installed gcc binaries.
In my case the version I had installed was '3.4.3-20050110'. Now use gcc-config to define it as your default compiler.

Code:

gcc-config i386-pc-linux-gnu-3.4.3-20050110


Now use your favorite text editor to edit your cflags in the /etc/make.conf file and edit the CFLAGS variable:

Code:

CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -fforce-addr  -mmmx -msse -msse2 -mfpmath=sse"


And finally you should re-bootstrap one last time:

Code:

cd /usr/portage/scripts
sh bootstrap.sh && env-update && source /etc/profile


Squeeze more performance out of your Pentium-M cpu, the testing/unstable way

If you're running the 'testing/unstable' branche you will only have to re-bootstrap once. Just follow the 'stable' steps starting from the CFLAGS part.


Optional: remerging your world

You can easily remerge all off your installed apps with a simple command line. It's not necessary. If you don't take this step, only the packages you install from now on will use the optimisations. It's up to you to decide whether it's usefull or not. Personally I did apply this final step.

Code:

emerge -e world


Let's hope this howto might be of any use to at least someone...
Back to top
View user's profile Send private message
moocha
Watchman
Watchman


Joined: 21 Oct 2003
Posts: 5722

PostPosted: Sun Apr 03, 2005 4:00 am    Post subject: Reply with quote

"Squeeze more performance out of your Pentium-M cpu, the stable way"? Ahem. You should REALLY, REALLY point out to people that they will be running a toolchain from the UNSTABLE, TESTING branch. Place that in huge letters somewhere. While, for example, gcc-3.4.3.20050110 is sort of OK as a compiler, and it works fine with the software that usually runs on an appserver or router, I know of five distinct known and documented bugs that haven't been fixed yet and that may affect desktop-type applications.
Also, please be careful with recommending CFLAGS. I suggest you don't recommend any - it leads to support nightmares and general cries of woe. Especially don't recommend things like -mfpmath=sse, which give a negligible speedup even in the best case, and slow things down in most cases.
_________________
Military Commissions Act of 2006: http://tinyurl.com/jrcto

"Those who would give up essential liberty to purchase a little temporary safety deserve neither liberty nor safety."
-- attributed to Benjamin Franklin
Back to top
View user's profile Send private message
Imrahil
n00b
n00b


Joined: 06 Feb 2003
Posts: 42
Location: Madison, Wisconsin, USA

PostPosted: Mon Apr 11, 2005 6:45 am    Post subject: Re: Optimising Gentoo for Pentium-M cpu's Reply with quote

Arioch84 wrote:
Optimising Gentoo for Pentium-M cpu's

Code:

CFLAGS="-O2 -march=pentium-m -fomit-frame-pointer -fforce-addr  -mmmx -msse -msse2 -mfpmath=sse"




-mmmx -msse and -msse2 are redundant with pentium-m cpu-type

For some more info and a lot more options than you ever cared about:
http://gcc.gnu.org/onlinedocs/gcc-3.4.3/
_________________
At length they came to the Prince Imrahil, and Legolas looked at him and bowed low; for he saw that here indeed was one who had elven-blood in his veins.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum