"CC_OPTIMIZE_FOR_PERFORMANCE_O3" Performance Tunable Dropped In Linux 6.0
Following recent upstream discussions around the -O3 compiler optimizations for the Linux kernel, the Kconfig switch advertising this option is being removed in Linux 6.0.
Back in June was a Linux kernel discussion around using -O3 compiler optimizations on the Linux kernel with there existing the "CC_OPTIMIZE_FOR_PERFORMANCE_O3" Kconfig switch that sets the "-O3" compiler flag for the kernel build but was limited to the ARC CPU architecture. There was a proposal to expand that option to be easily used by any CPU architecture for the kernel while clearly marking it as experimental.
From that discussion, Linus Torvalds once gain came out against -O3 optimizing the kernel due to the potential of hard-to-diagnose/reproduce bugs introduced by the compiler optimizations. Other upstream kernel developers also criticized that higher optimization level over the default -O2 level due to the risks, particularly with older compilers and memories from times when -O3 tended to be more buggy.
Additionally, this dedicated Kconfig switch really isn't needed when the same application can be achieved with setting "KCFLAGS=-O3."
So now with the Kbuild updates for Linux 6.0, the CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is being removed entirely.
Those wishing to better optimize their kernel for performance can still resort to using "KCFLAGS=-O3" though my -O3 Linux kernel build benchmarks from this summer didn't show it to be particularly worthwhile.
Back in June was a Linux kernel discussion around using -O3 compiler optimizations on the Linux kernel with there existing the "CC_OPTIMIZE_FOR_PERFORMANCE_O3" Kconfig switch that sets the "-O3" compiler flag for the kernel build but was limited to the ARC CPU architecture. There was a proposal to expand that option to be easily used by any CPU architecture for the kernel while clearly marking it as experimental.
From that discussion, Linus Torvalds once gain came out against -O3 optimizing the kernel due to the potential of hard-to-diagnose/reproduce bugs introduced by the compiler optimizations. Other upstream kernel developers also criticized that higher optimization level over the default -O2 level due to the risks, particularly with older compilers and memories from times when -O3 tended to be more buggy.
Additionally, this dedicated Kconfig switch really isn't needed when the same application can be achieved with setting "KCFLAGS=-O3."
So now with the Kbuild updates for Linux 6.0, the CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3 is being removed entirely.
Those wishing to better optimize their kernel for performance can still resort to using "KCFLAGS=-O3" though my -O3 Linux kernel build benchmarks from this summer didn't show it to be particularly worthwhile.
58 Comments