View previous topic :: View next topic |
Author |
Message |
reves Apprentice
Joined: 25 Jun 2002 Posts: 215 Location: South Florida
|
Posted: Thu Sep 19, 2002 3:55 pm Post subject: New kernel |
|
|
I recently updated to the latest Gentoo sources and when making the kernel it compiled with the -Os option. I believe normally it compiles with the -O2 option. I didn't notice any options in menuconfig for it. How can I cahnge this? _________________ Robert |
|
Back to top |
|
|
pilla Bodhisattva
Joined: 07 Aug 2002 Posts: 7729 Location: Underworld
|
Posted: Thu Sep 19, 2002 5:03 pm Post subject: Re: New kernel |
|
|
Probably by editing the Makefile it generates, changing the HOSTCFLAGS variable.
I don't know if it is a good idea, anyway
reves wrote: | I recently updated to the latest Gentoo sources and when making the kernel it
compiled with the -Os option. I believe normally it compiles with the -O2 option. I didn't notice any options in menuconfig for it. How can I cahnge this? |
|
|
Back to top |
|
|
phong Bodhisattva
Joined: 16 Jul 2002 Posts: 778 Location: Michigan - 15 & Ryan
|
Posted: Thu Sep 19, 2002 5:36 pm Post subject: |
|
|
I'm a little surprised we haven't heard more about this (I'm going to check out the new kernel when I get home tonight), but as a side note, the performance of code generated with -Os is pretty close to the performance of -O2 (and much better than -O0). Most optimizations that improve the speed of a program also make the program smaller. I suppose someone decided that the reduced size of the kernel and corresponding memory usage justified the change. Maybe they're right! _________________ "An empty head is not really empty; it is stuffed with rubbish. Hence the difficulty of forcing anything into an empty head."
-- Eric Hoffer |
|
Back to top |
|
|
pilla Bodhisattva
Joined: 07 Aug 2002 Posts: 7729 Location: Underworld
|
Posted: Thu Sep 19, 2002 6:44 pm Post subject: |
|
|
-O0 means no register allocation, as long as I remember. Everytime you use a variable, it needs a load and after that a store....
phong wrote: | I'm a little surprised we haven't heard more about this (I'm going to check out the new kernel when I get home tonight), but as a side note, the performance of code generated with -Os is pretty close to the performance of -O2 (and much better than -O0). Most optimizations that improve the speed of a program also make the program smaller. I suppose someone decided that the reduced size of the kernel and corresponding memory usage justified the change. Maybe they're right! |
|
|
Back to top |
|
|
phong Bodhisattva
Joined: 16 Jul 2002 Posts: 778 Location: Michigan - 15 & Ryan
|
Posted: Thu Sep 19, 2002 7:03 pm Post subject: |
|
|
Wow, when they say "no optimization" they aren't kidding. I always thought of register allocation as a "necessary function for a working compiler", and then optimization would include a _better_ register allocator.
Anyhoo, here's a page that compares different compiler flags (including -Os) and performance (scroll to the bottom for the "average" score.) It's with gcc 3.0.1 which nobody is using right now, but I'm sure it's similar ballpark. _________________ "An empty head is not really empty; it is stuffed with rubbish. Hence the difficulty of forcing anything into an empty head."
-- Eric Hoffer |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Thu Sep 19, 2002 7:32 pm Post subject: |
|
|
I'm a little late to the party, but as is detailed in here, you don't need to edit any Makefiles. Just pass something for CFLAGS_KERNEL on the command line. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
pilla Bodhisattva
Joined: 07 Aug 2002 Posts: 7729 Location: Underworld
|
Posted: Thu Sep 19, 2002 8:06 pm Post subject: |
|
|
I think it was meant to be used with debbuging.... you always have memory updated....
phong wrote: | Wow, when they say "no optimization" they aren't kidding. I always thought of register allocation as a "necessary function for a working compiler", and then optimization would include a _better_ register allocator.
Anyhoo, here's a page that compares different compiler flags (including -Os) and performance (scroll to the bottom for the "average" score.) It's with gcc 3.0.1 which nobody is using right now, but I'm sure it's similar ballpark. |
|
|
Back to top |
|
|
reves Apprentice
Joined: 25 Jun 2002 Posts: 215 Location: South Florida
|
Posted: Tue Sep 24, 2002 10:44 pm Post subject: |
|
|
I did a new install of 1.4rc1 and used gentoo-sources-r9 again. It used -Os again. I'm not sure if I really want to re-compile the kernel again. Do you think I would see that much more preformance from using -O2? _________________ Robert |
|
Back to top |
|
|
|