Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
New kernel
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
reves
Apprentice
Apprentice


Joined: 25 Jun 2002
Posts: 215
Location: South Florida

PostPosted: Thu Sep 19, 2002 3:55 pm    Post subject: New kernel Reply with quote

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
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Thu Sep 19, 2002 5:03 pm    Post subject: Re: New kernel Reply with quote

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
View user's profile Send private message
phong
Bodhisattva
Bodhisattva


Joined: 16 Jul 2002
Posts: 778
Location: Michigan - 15 & Ryan

PostPosted: Thu Sep 19, 2002 5:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Thu Sep 19, 2002 6:44 pm    Post subject: Reply with quote

-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
View user's profile Send private message
phong
Bodhisattva
Bodhisattva


Joined: 16 Jul 2002
Posts: 778
Location: Michigan - 15 & Ryan

PostPosted: Thu Sep 19, 2002 7:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Thu Sep 19, 2002 7:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Thu Sep 19, 2002 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
reves
Apprentice
Apprentice


Joined: 25 Jun 2002
Posts: 215
Location: South Florida

PostPosted: Tue Sep 24, 2002 10:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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