Skip to content

Commit 281dc5c

Browse files
committed
Give up on pushing CC_OPTIMIZE_FOR_SIZE
I still happen to believe that I$ miss costs are a major thing, but sadly, -Os doesn't seem to be the solution. With or without it, gcc will miss some obvious code size improvements, and with it enabled gcc will sometimes make choices that aren't good even with high I$ miss ratios. For example, with -Os, gcc on x86 will turn a 20-byte constant memcpy into a "rep movsl". While I sincerely hope that x86 CPU's will some day do a good job at that, they certainly don't do it yet, and the cost is higher than a L1 I$ miss would be. Some day I hope we can re-enable this. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 71a8638 commit 281dc5c

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

‎init/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,6 @@ endif
908908

909909
config CC_OPTIMIZE_FOR_SIZE
910910
bool "Optimize for size"
911-
default y
912911
help
913912
Enabling this option will pass "-Os" instead of "-O2" to gcc
914913
resulting in a smaller kernel.

0 commit comments

Comments
 (0)