Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[HOWTO] Flying with gentoo
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4, 5, 6  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Sheepdogj15
Guru
Guru


Joined: 07 Jan 2005
Posts: 430
Location: Backyard

PostPosted: Sat May 21, 2005 1:39 am    Post subject: Re: [HOWTO] Flying with gentoo Reply with quote

asph wrote:


Code:
CHOST="i686-pc-linux-gnu"
CFLAGS="-march=pentium4 -mcpu=pentium4 -O3 -pipe -fforce-addr -falign-functions=4 -fprefetch-loop-arrays -fomit-frame-pointer"


note: cflags changed a little bit in gcc 3.4.X and -mcpu is deprecated, you should use -mtune instead. Moreover, pentium-m is accepted for centrino laptops.


just FYI, from the GCC documentation, "Moreover, specifying -march=cpu-type implies -mtune=cpu-type."

you can check out the GCC documentation here: http://www.gnu.org/software/gcc/onlinedocs/ (just go to the first one for your version number... they are pretty comprehensive in describing what each option does. there's a specific section on optimizations, that anyone here ought to consider looking at.)
_________________
Sheepdog
Why Risk It? | Samba Howto
Back to top
View user's profile Send private message
FastTurtle
Guru
Guru


Joined: 03 Sep 2002
Posts: 413
Location: Shake & Bake

PostPosted: Wed Jun 08, 2005 1:55 am    Post subject: My How-To Speed Bootup Reply with quote

I had the same problem that many complain about. Boot took over 2m20s to complete and after extensive reading, I finally found a solution that requires no editing of scripts, just simple changes to rc-update an a single kernel config change.

The change I made to rc-update was to remove netmount and that saved 1+min of time by itself. The other change was to change the kernel config and convert automount to a module and load it into modules.autoload.d/kernel-2.x.. Between these to changes, I was able to improve my boot speed from lilo prompt to log-in to less then 30 seconds.

It really doesn't take much to improve Gentoos boot speed significantly. The 1st thing to always examine is what services are starting and to disable those that you don't need. This is also the beginning of securing your system. Don't start services unless really need them. In fact I would like to see netmount being removed from rc-update and all services that aren't explictly needed to boot disabled by default. If you need them, then you add them in as the OpenBSD folks believe.

System Config: Stage1 using 2005.0 live cd No ntpl
XP1800; 1024 mem 60 gig WD /home 15.3 Seagate / and remainder
cflag -march -O1 -pipe
_________________
AsRock Q87M with E3-1230 Xeon (Haswell)
16GB RAM - Geforce GT640 2GB
Crucial M500 120GB SSD (Windows Boot)
Seagate 250GB Barracuda (linux disk)- Samsung 1TB Spinpoint - WD 2TB Green - Seagate 3TB
Back to top
View user's profile Send private message
Bitspyer
Apprentice
Apprentice


Joined: 17 Dec 2002
Posts: 211
Location: Mainz, Germany

PostPosted: Wed Jun 08, 2005 1:59 pm    Post subject: Reply with quote

Does anyone tried init-ng? If this works like they say, it should boost up the boot process.

I've tried it, but it hangs, when my network comes up.:roll:
_________________
Der Weg zur Dunklen Seite... Schneller er ist, verführerischer, leichter.
Back to top
View user's profile Send private message
Varg_
n00b
n00b


Joined: 07 Jun 2005
Posts: 10
Location: Toronto, Canada

PostPosted: Thu Jun 09, 2005 6:12 am    Post subject: Reply with quote

I've installed and tried it with my gentoo64, It more than halved my boot time to around 17 seconds or so.

But it is broken with nvidia drivers, and there are apparently some network issues; its encouraged for you write or edit your own init scripts to get things like network working properly however - the standard sysV init scripts are incompatible with initng
_________________
Tautological Defenestration
Back to top
View user's profile Send private message
hellspawn
n00b
n00b


Joined: 15 Jun 2005
Posts: 22

PostPosted: Fri Jun 17, 2005 1:38 pm    Post subject: Reply with quote

Anyone got an operation not permited when tryng to set dma?
I got this and i wonder how to get around it.
Back to top
View user's profile Send private message
Plazmic
n00b
n00b


Joined: 18 Feb 2005
Posts: 34
Location: Florida

PostPosted: Tue Aug 09, 2005 3:53 pm    Post subject: Reply with quote

Excellent guide! In someways a bit too agressive for my liking but nonetheless very helpful :)

InitNG had my system booting in under 15 seconds... that said it is still an alpha build. Eventually it will completely deprecate sysvinit (in my opinion) but I would recommend not using it for production enviroments much less if you don't know exactly what your doing. Theres alot of configuration incompatabilities as previously stated.

Also in:
Code:
 CFLAGS="-O3 -march=pentium-m -mtune=pentium-m -pipe -ftracer -fomit-frame-pointer -ffast-math -momit-leaf-frame-pointers"


Code:
-momit-leaf-frame-pointers
should not have an s at the end. The correct flag is
Code:
-momit-leaf-frame-pointer


Regarding that, can anyone verify if using -fomit-frame-pointer with -momit-leaf-frame-pointer is redundant? I was under the influence that -momit-..-.. was implied by -fomit-..-.. because -fomit-..-.. frees the register in all pointer functions or something along those lines.
_________________
..::I reject your reality and substitute my own::..
Back to top
View user's profile Send private message
lnxz
Guru
Guru


Joined: 03 Jul 2005
Posts: 472
Location: Earth

PostPosted: Tue Aug 09, 2005 8:03 pm    Post subject: Reply with quote

Well, as I understand the gcc info page on gcc optimizations -fomit-frame-pointer makes gcc not keep the frame pointer in a register for functions that don't need one, it doesn't disable keeping frame pointers for all functions.
I think leaf frame pointers are different from regular frame pointers, but I'm not sure, though.
Back to top
View user's profile Send private message
asph
l33t
l33t


Joined: 25 Aug 2003
Posts: 738
Location: Barcelona, Spain

PostPosted: Mon Sep 19, 2005 6:14 pm    Post subject: Reply with quote

i am planning a major update (re-write) of the guide in order to update it, i would like to ask for a little collaboration to make it wider and add more tweaks for the system.. it will take me a while because I want to do it right and extense, if you think you can add something or want some feature to be commented please feel free to p.m. me :)
_________________
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Back to top
View user's profile Send private message
Enlight
Advocate
Advocate


Joined: 28 Oct 2004
Posts: 3519
Location: Alsace (France)

PostPosted: Tue Sep 20, 2005 3:32 pm    Post subject: Reply with quote

Plazmic wrote:
Excellent guide! In someways a bit too agressive for my liking but nonetheless very helpful :)

InitNG had my system booting in under 15 seconds... that said it is still an alpha build. Eventually it will completely deprecate sysvinit (in my opinion) but I would recommend not using it for production enviroments much less if you don't know exactly what your doing. Theres alot of configuration incompatabilities as previously stated.

Also in:
Code:
 CFLAGS="-O3 -march=pentium-m -mtune=pentium-m -pipe -ftracer -fomit-frame-pointer -ffast-math -momit-leaf-frame-pointers"


Code:
-momit-leaf-frame-pointers
should not have an s at the end. The correct flag is
Code:
-momit-leaf-frame-pointer


Regarding that, can anyone verify if using -fomit-frame-pointer with -momit-leaf-frame-pointer is redundant? I was under the influence that -momit-..-.. was implied by -fomit-..-.. because -fomit-..-.. frees the register in all pointer functions or something along those lines.


momit-leaf-frame-pointer is redondant whan using -fomit-frame-pointer is in use but not the contrary.

man gcc wrote:
-momit-leaf-frame-pointer
Don't keep the frame pointer in a register for leaf functions.
This avoids the instructions to save, set up and restore frame
pointers and makes an extra register available in leaf functions.
The option -fomit-frame-pointer removes the frame pointer for all
functions which might make debugging harder.


Now question is what are "leaf" functions?
Back to top
View user's profile Send private message
TGL
Bodhisattva
Bodhisattva


Joined: 02 Jun 2002
Posts: 1978
Location: Rennes, France

PostPosted: Tue Sep 20, 2005 4:37 pm    Post subject: Reply with quote

Enlight wrote:
Now question is what are "leaf" functions?
A function which doesn't call any other function. See: http://gcc.gnu.org/onlinedocs/gccint/Leaf-Functions.html
Back to top
View user's profile Send private message
user118696
Apprentice
Apprentice


Joined: 16 Sep 2005
Posts: 276

PostPosted: Tue Sep 20, 2005 4:39 pm    Post subject: Reply with quote

Interesting. Thx.
Back to top
View user's profile Send private message
karmarcoma
n00b
n00b


Joined: 16 Dec 2004
Posts: 2
Location: Germany

PostPosted: Mon Oct 24, 2005 11:42 pm    Post subject: Starting xdm at the end of boot runlevel... Reply with quote

what about this:

/etc/init.d/xdm
find the line which reads
Code:
/sbin/telinit a &>/dev/null
and change it to
Code:
/etc/X11/startDM.sh &>/dev/null

this way xdm wont start at the end of the default runlevel but right when the script's executed 8)

now move xdm from default runlevel to boot runlevel

works for me... is this dangerous/stupid?
_________________
*karmarcoma
Back to top
View user's profile Send private message
TGL
Bodhisattva
Bodhisattva


Joined: 02 Jun 2002
Posts: 1978
Location: Rennes, France

PostPosted: Mon Oct 24, 2005 11:54 pm    Post subject: Re: Starting xdm at the end of boot runlevel... Reply with quote

karmarcoma wrote:
is this dangerous/stupid?

Not really. You can check bug #70689 for more discussion on that topic.
Back to top
View user's profile Send private message
Gotterdammerung
l33t
l33t


Joined: 11 Feb 2004
Posts: 627
Location: Rio de Janeiro, Brazil

PostPosted: Thu Nov 24, 2005 11:41 pm    Post subject: Reply with quote

really cool! I'm trying some of these tips right now.
_________________
A mind that is stretched by a new experience can never go back to its old dimensions. - Oliver Wendell Holmes
Back to top
View user's profile Send private message
enderandrew
l33t
l33t


Joined: 25 Oct 2005
Posts: 731

PostPosted: Fri Nov 25, 2005 2:14 pm    Post subject: Reply with quote

From what I understand, it is preferred to use the glibc-omitfp use flag over the -fomit-leaf-frame-pointer CFLAG. It is less likely to break things. It allows glibc to decide when to omit frame pointers.
_________________
Nihilism makes me smile.
Back to top
View user's profile Send private message
shadowscythe
n00b
n00b


Joined: 06 Dec 2005
Posts: 1

PostPosted: Tue Dec 06, 2005 10:12 am    Post subject: dma Reply with quote

hellspawn wrote:
Anyone got an operation not permited when tryng to set dma?
I got this and i wonder how to get around it.


I was getting this error as well. After a few mins of thinking of all the stupid things I could have possibly done...
I went to the kernel config and lo and behold... someone forgot to set the correct driver for the pci chipset in Device Drivers->ATA/ATPI...-> :oops:

Works great after that

Code:
/dev/hda:
 Timing cached reads:   2040 MB in  2.01 seconds = 1015.87 MB/sec
 Timing buffered disk reads:  114 MB in  3.04 seconds =  37.45 MB/sec


Code:
/dev/hdb:
 Timing cached reads:   2036 MB in  2.00 seconds = 1017.94 MB/sec
 Timing buffered disk reads:   44 MB in  3.03 seconds =  14.53 MB/sec


They were 45MB/sec and 50MB/sec in Single User Mode respectively.. before dma... a dismal 3.5MB/sec
Back to top
View user's profile Send private message
crys0000
n00b
n00b


Joined: 11 Jan 2006
Posts: 44
Location: Todi, Italy

PostPosted: Sun Feb 12, 2006 8:16 am    Post subject: Reply with quote

I don't have any /etc/init.d/service file in my system... :?
Back to top
View user's profile Send private message
ZiffyWombat
n00b
n00b


Joined: 06 Sep 2004
Posts: 64
Location: Earth, Europe, Scandinavia, Finland, Nokia

PostPosted: Wed Mar 08, 2006 12:13 pm    Post subject: Reply with quote

I would recommend compiling all of your boot programs with the
Code:
CFLAGS="-Os  -march=arch -pipe"
CXXFLAGS="-Os -march=arch -pipe -fvisibility-inlines-hidden"

Flags. Considering -O3 heavily bloats the code, it probably would'nt be the best choice for boot proggies..
Combined with LDFLAGS and prelink, this should cut boot time by a few seconds.
_________________
Nick on freenode #gentoo
NeeXt

---
http://www.gutenberg.org/dirs/1/3/132/132a-h/132a-h.htm
Back to top
View user's profile Send private message
asph
l33t
l33t


Joined: 25 Aug 2003
Posts: 738
Location: Barcelona, Spain

PostPosted: Mon Jul 31, 2006 7:30 am    Post subject: Reply with quote

added performance tips for kernel 2.6 and for kde users (thanks xdarma for the links)
_________________
gentoo sex is updatedb; locate; talk; date; cd; strip; look; touch; finger; unzip; uptime; gawk; head; emerge --oneshot condom; mount; fsck; gasp; more; yes; yes; yes; more; umount; emerge -C condom; make clean; sleep
Back to top
View user's profile Send private message
yoshi314
l33t
l33t


Joined: 30 Dec 2004
Posts: 848
Location: PL

PostPosted: Thu Aug 03, 2006 8:18 am    Post subject: Reply with quote

using a separate partition for portage workdir (compilation directory and ccache dir) makes such a big difference. [sounds obvious, heh].

i also noticed that it was a bad idea to try reiser4 with that partition - that fs put some stress on cpu on compilation, and interfered with compilation a bit (most noticeable with packages that have thousands of source files to compile). ext3 with dir_index tweak did much better job.

i don't want to state the obvious, but it also reduces the mess in your root partition. and that really shows, after a couple of dozens of merged packages.
_________________
~amd64
shrink your /usr/portage with squashfs+aufs
Back to top
View user's profile Send private message
mostro
n00b
n00b


Joined: 20 May 2005
Posts: 26

PostPosted: Wed Aug 16, 2006 3:34 pm    Post subject: Reply with quote

Here is a small, but important detail about the code given to determine if modules-update should be executed or not.

If you only look at the mtime of the /etc/modules.d directory, you will be missing potential changes to the actual files within the directory. So a better alternative is:

for File in /etc/modules.d/*; do
if [ "$File" -nt /etc/modprobe.conf ]; then
# modules-update code goes here.
# ...
break
fi
done

The reason for the "break" is that once modules-update runs, there is no point in continuing to check the other files... I hope this helps someone out there.
Back to top
View user's profile Send private message
ygor
n00b
n00b


Joined: 28 Oct 2006
Posts: 2

PostPosted: Sun Nov 05, 2006 8:34 am    Post subject: Really useful!!! Reply with quote

I liked a lot, congratulations for the good work.

Can you give a word about init-ng????

Also do you know any hdparm like application that currently works with the latest SATA drivers???


Thanks,

Ygor Lemos
Back to top
View user's profile Send private message
ebfe
n00b
n00b


Joined: 29 Jan 2006
Posts: 20

PostPosted: Mon Nov 06, 2006 4:18 pm    Post subject: Reply with quote

most of the general tips and like all of the cflags in the first post won't lead to any performance gain, are incorrectly discribed and in general just bogus. you may also add -fflux-capacitor or -frearrange-dilithium-core

btw take a look at some ebuilds and you'll see that some of the most popular packages filter cflags.
Back to top
View user's profile Send private message
cfriedt
n00b
n00b


Joined: 12 Sep 2003
Posts: 56
Location: Montréal, Québec

PostPosted: Tue Jun 12, 2007 10:35 am    Post subject: Re: [HOWTO] Flying with gentoo Reply with quote

asph wrote:

11. Halt vs Suspend

Have you never asked yourself why you shutdown you computer, when you can suspend it to ram or disk?
If you suspend to ram, it has the handicap that it will still need AC input in order to keep the system alive. But suspending to disk is very useful (specially for laptops), because the laptop will "shutdown", but we will keep our sesion.

Doing it this way we avoid to boot all the system services everytime (it not an instant recuperation from the "sleep", but seems faster).
I have used swsusp2 in my laptop and works fine, but you have to patch the kernel sources. You can find info in THIS post on how to do this. Try it and you won't regret.


This should read "it will draw a minimal amount of power" instead of "it will still need AC input".

That covers the case of a laptop, desktop pc, or any other form of computer as well :)
Back to top
View user's profile Send private message
monsm
Guru
Guru


Joined: 26 Sep 2007
Posts: 467
Location: London, UK

PostPosted: Fri Oct 05, 2007 11:14 am    Post subject: Reply with quote

Hi,
This looks like some very good advice. It is now just past its 3 year birthday since it was originally posted and a year since the last edit.

I guess this is still reasonably relevant?

Shouldn't this be on the wiki instead? or is it already there somehwere?
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
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 5 of 6

 
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