
This week the kernel CPU options patch was suggested for mainlining in the Linux kernel. The patch adds extra CPU options to the kernel configuration (Kconfig) area for adjusting the GCC optimization values for various generations of Intel/AMD CPUs. It allows building the kernel ranging from -march=k8-sse3 to -march=cannonlake, among other prominent generations of Intel/AMD processors over the years.
While the patch is just about adjusting the kernel build's march/mtune parameters, the Gentoo patch maintainer's testing points out "there are small but real speed increases to running with this patch."
However, these sorts of patches never end up getting mainlined. As was the case this week, it was quickly shot down while referencing past objections. Those objections come down to the belief that the compiler optimization benefit for the kernel is miniscule, concerns over how maintainable this code is, the possibility of the compiler tuning introducing regressions, and GCC compiler changes could end up hurting the performance.
There has been talk of offering more generic Kconfig tunables about just optimizing for "modern" Intel/AMD CPUs rather than a bunch of per-generation configuration options, but so far such global knobs haven't been introduced.
49 Comments