[arch-general] CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
Hi, can someone tell my whats the reason for building the arch-kernel with "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set"? Thank you! Greetings, hardcore ______________________ You live in a fabricated world. Regulated by complex laws. Controlled by national governments. Governments restrained by international authorities, Watched by enforcers that are controlled. Controlled by controllers that ironically enough Are also controlled. CTRL.ALT.DELETE
Am Thu, 22 Oct 2009 20:37:34 +0200 schrieb Sascha Siegel <nustyle@me.com>:
Hi,
can someone tell my whats the reason for building the arch-kernel with "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set"?
Thank you!
Greetings, hardcore
That's almost the same like CFLAG -Os. We don't optimize for embedded devices with small memory. We prefer our systemwide -O2 flag to gain speed improvements. -Andy
Sascha Siegel schrieb:
Hi,
can someone tell my whats the reason for building the arch-kernel with "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set"?
Thank you!
Optimizing for size sacrifices performance. Read the gcc documentation about the -O{1,2,3,s} options.
On Thu, Oct 22, 2009 at 11:06:32PM +0200, Thomas Bächler wrote:
Sascha Siegel schrieb:
Hi,
can someone tell my whats the reason for building the arch-kernel with "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set"?
Thank you!
Optimizing for size sacrifices performance. Read the gcc documentation about the -O{1,2,3,s} options.
I don't know if it is as simple as that. I recall reading somewhere that under certain circumstances a binary optimized with -Os is faster than a binary optimized with -O2. The reason for this is that a smaller binary may load faster than a big one and cause less page faults.
On Thu, Oct 22, 2009 at 5:54 PM, André Ramaciotti da Silva <andre.ramaciotti@gmail.com> wrote:
On Thu, Oct 22, 2009 at 11:06:32PM +0200, Thomas Bächler wrote:
Sascha Siegel schrieb:
Hi,
can someone tell my whats the reason for building the arch-kernel with "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set"?
Thank you!
Optimizing for size sacrifices performance. Read the gcc documentation about the -O{1,2,3,s} options.
I don't know if it is as simple as that. I recall reading somewhere that under certain circumstances a binary optimized with -Os is faster than a binary optimized with -O2.
The reason for this is that a smaller binary may load faster than a big one and cause less page faults.
I really doubt the kernel is even close to the boundary for something like this
On Thu, Oct 22, 2009 at 06:15:45PM -0500, Aaron Griffin wrote:
On Thu, Oct 22, 2009 at 5:54 PM, André Ramaciotti da Silva <andre.ramaciotti@gmail.com> wrote:
On Thu, Oct 22, 2009 at 11:06:32PM +0200, Thomas Bächler wrote:
Sascha Siegel schrieb:
Hi,
can someone tell my whats the reason for building the arch-kernel with "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set"?
Thank you!
Optimizing for size sacrifices performance. Read the gcc documentation about the -O{1,2,3,s} options.
I don't know if it is as simple as that. I recall reading somewhere that under certain circumstances a binary optimized with -Os is faster than a binary optimized with -O2.
The reason for this is that a smaller binary may load faster than a big one and cause less page faults.
I really doubt the kernel is even close to the boundary for something like this
Agreed, especially as the kernel is loaded only once. I just went a little bit off-topic while still on-topic. :)
Optimizing for size sacrifices performance. Read the gcc documentation about the -O{1,2,3,s} options.
I don't know if it is as simple as that. I recall reading somewhere that under certain circumstances a binary optimized with -Os is faster than a binary optimized with -O2.
The reason for this is that a smaller binary may load faster than a big one and cause less page faults.
not page faults but the issue is about the CPU L1/L2 cache strain. BTW, the help entry says | CONFIG_CC_OPTIMIZE_FOR_SIZE: | Enabling this option will pass "-Os" instead of "-O2" to gcc | resulting in a smaller kernel. | If unsure, say Y. alsi Ingo Molnar says here http://lkml.org/lkml/2007/9/13/88 : | also, if you want to maximize performance, it usually makes more sense | to build with these flipped around: | | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | CONFIG_FORCED_INLINING=y | | i.e.: | | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | # CONFIG_FORCED_INLINING is not set | | because especially on modern x86 CPUs, smaller x86 code is faster. (and | it also takes up less I-cache size) -- damjan
Sascha Siegel schrieb:
Hi,
can someone tell my whats the reason for building the arch-kernel with "# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set"?
Thank you!
Optimizing for size sacrifices performance. Read the gcc documentation about the -O{1,2,3,s} options.
I remember a few kernel devs recommending size. It was to reduce the number of cache misses and improve CPU cache utilisation, avoiding RAM and L2 cache. Fedora/RHEL appears to optimize for size. That was a while ago when I was doing some kernel stuff.... so I could be wrong.
participants (7)
-
Aaron Griffin
-
Andreas Radke
-
André Ramaciotti da Silva
-
Damjan Georgievski
-
James Rayner
-
Sascha Siegel
-
Thomas Bächler