Public bug reported:

 There are a couple recent threads on lkml where the conclusion seems to be 
that CONFIG_OPTIMIZE_INLINING is not ready for use yet, and probably won't be 
until gcc 4.4 or 4.5.  And that it was a mistake for it to be on in the 
defconfig, which is probably why it's on in Ubuntu's kernels:  in Jaunty's 
kernel git tree:
grep CONFIG_OPTIMIZE_INLINING debian/config/*/*
debian/config/amd64/config:CONFIG_OPTIMIZE_INLINING=y
debian/config/i386/config:CONFIG_OPTIMIZE_INLINING=y

 It's in the "kernel hacking" section, right at the very end of the
menu, if you use menuconfig or xconfig, BTW.

The threads: http://lkml.org/lkml/2008/11/14/203
http://lkml.org/lkml/2009/1/4/289

CONFIG_OPTIMIZE_INLINING removes the workaround of defining inline as a
macro for "inline __attribute__((always_inline))".  (include/linux
/compiler-gcc.h)  This doesn't work well yet, because gcc will decide
not to inline some functions that only generate decent code when
inlined.  e.g. constant_test_bit is only used if the bit number
arguments is  __builtin_constant_p(), so it will hopefully compile to an
x86 "test" instruction, not a bunch of shifts and sometimes even an
idiv.  Anyway, a horrible 18 amd64 instructions long function. The other
case of test_bit uses variable_test_bit, which uses inline asm (on x86)
"bt; sbb".

 To see how many non-inlined copies of static inline int constant_test_bit() a 
kernel image has: do
grep -c constant_test_bit /boot/System.map-2.6.27-11-generic 
62

Jaunty: 
88 /mnt/ubuntu-testing/boot/System.map-2.6.28-6-generic 
My custom-configured Jaunty kernel:
113 /boot/System.map-2.6.28-7-tesla  (maybe some of the config options I turned 
off make more things compile-time constants)

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
default config includes CONFIG_OPTIMIZE_INLINING=y
https://bugs.launchpad.net/bugs/327788
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to